diff --git a/Makefile b/Makefile index a6b175dd4be..1085b0624b8 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,9 @@ CLIENT_JARS_BUCKET="s3://treeverse-clients-us-east/" # https://openapi-generator.tech OPENAPI_LEGACY_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v5.3.0 OPENAPI_LEGACY_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_LEGACY_GENERATOR_IMAGE) -OPENAPI_GENERATOR_IMAGE=treeverse/openapi-generator-cli:v7.0.0.1 +OPENAPI_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v7.8.0 OPENAPI_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_GENERATOR_IMAGE) -OPENAPI_RUST_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v7.5.0 +OPENAPI_RUST_GENERATOR_IMAGE=openapitools/openapi-generator-cli:v7.8.0 OPENAPI_RUST_GENERATOR=$(DOCKER) run --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_RUST_GENERATOR_IMAGE) PY_OPENAPI_GENERATOR=$(DOCKER) run -e PYTHON_POST_PROCESS_FILE="/mnt/clients/python/scripts/pydantic.sh" --user $(UID_GID) --rm -v $(shell pwd):/mnt $(OPENAPI_GENERATOR_IMAGE) diff --git a/clients/java/.openapi-generator/VERSION b/clients/java/.openapi-generator/VERSION index 4122521804f..09a6d30847d 100644 --- a/clients/java/.openapi-generator/VERSION +++ b/clients/java/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.0 \ No newline at end of file +7.8.0 diff --git a/clients/java/README.md b/clients/java/README.md index 805e4947aec..91814049bd3 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -2,6 +2,7 @@ lakeFS API - API version: 1.0.0 + - Generator version: 7.8.0 lakeFS HTTP API diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index f991b4f0e81..c4e24805478 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -53,7 +53,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /setup_lakefs: get: operationId: getSetupState @@ -76,7 +77,8 @@ paths: summary: check if the lakeFS installation is already set up tags: - internal - x-accepts: application/json + x-accepts: + - application/json post: operationId: setup requestBody: @@ -117,7 +119,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /user: get: operationId: getCurrentUser @@ -131,7 +134,8 @@ paths: summary: get current user tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/login: post: operationId: login @@ -173,7 +177,8 @@ paths: tags: - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/external/principal/login: post: operationId: externalPrincipalLogin @@ -228,7 +233,8 @@ paths: - experimental - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /sts/login: post: operationId: stsLogin @@ -264,7 +270,8 @@ paths: tags: - experimental x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/capabilities: get: operationId: getAuthCapabilities @@ -287,7 +294,8 @@ paths: summary: list authentication capabilities supported tags: - internal - x-accepts: application/json + x-accepts: + - application/json /auth/users: get: operationId: listUsers @@ -343,7 +351,8 @@ paths: summary: list users tags: - auth - x-accepts: application/json + x-accepts: + - application/json post: operationId: createUser requestBody: @@ -388,7 +397,8 @@ paths: tags: - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}: delete: operationId: deleteUser @@ -426,7 +436,8 @@ paths: summary: delete user tags: - auth - x-accepts: application/json + x-accepts: + - application/json get: operationId: getUser parameters: @@ -467,7 +478,8 @@ paths: summary: get user tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/groups: get: operationId: listGroups @@ -523,7 +535,8 @@ paths: summary: list groups tags: - auth - x-accepts: application/json + x-accepts: + - application/json post: operationId: createGroup requestBody: @@ -562,7 +575,8 @@ paths: tags: - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/groups/{groupId}: delete: operationId: deleteGroup @@ -600,7 +614,8 @@ paths: summary: delete group tags: - auth - x-accepts: application/json + x-accepts: + - application/json get: operationId: getGroup parameters: @@ -641,7 +656,8 @@ paths: summary: get group tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/policies: get: operationId: listPolicies @@ -697,7 +713,8 @@ paths: summary: list policies tags: - auth - x-accepts: application/json + x-accepts: + - application/json post: operationId: createPolicy requestBody: @@ -743,7 +760,8 @@ paths: tags: - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/policies/{policyId}: delete: operationId: deletePolicy @@ -781,7 +799,8 @@ paths: summary: delete policy tags: - auth - x-accepts: application/json + x-accepts: + - application/json get: operationId: getPolicy parameters: @@ -822,7 +841,8 @@ paths: summary: get policy tags: - auth - x-accepts: application/json + x-accepts: + - application/json put: operationId: updatePolicy parameters: @@ -876,7 +896,8 @@ paths: tags: - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/groups/{groupId}/members: get: operationId: listGroupMembers @@ -939,7 +960,8 @@ paths: summary: list group members tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/groups/{groupId}/members/{userId}: delete: operationId: deleteGroupMembership @@ -984,7 +1006,8 @@ paths: summary: delete group membership tags: - auth - x-accepts: application/json + x-accepts: + - application/json put: operationId: addGroupMembership parameters: @@ -1028,7 +1051,8 @@ paths: summary: add group membership tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/credentials: get: operationId: listUserCredentials @@ -1097,7 +1121,8 @@ paths: summary: list user credentials tags: - auth - x-accepts: application/json + x-accepts: + - application/json post: operationId: createCredentials parameters: @@ -1138,7 +1163,8 @@ paths: summary: create credentials tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/credentials/{accessKeyId}: delete: operationId: deleteCredentials @@ -1183,7 +1209,8 @@ paths: summary: delete credentials tags: - auth - x-accepts: application/json + x-accepts: + - application/json get: operationId: getCredentials parameters: @@ -1231,7 +1258,8 @@ paths: summary: get credentials tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/groups: get: operationId: listUserGroups @@ -1300,7 +1328,8 @@ paths: summary: list user groups tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/policies: get: operationId: listUserPolicies @@ -1379,7 +1408,8 @@ paths: summary: list user policies tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/policies/{policyId}: delete: operationId: detachPolicyFromUser @@ -1424,7 +1454,8 @@ paths: summary: detach policy from user tags: - auth - x-accepts: application/json + x-accepts: + - application/json put: operationId: attachPolicyToUser parameters: @@ -1468,7 +1499,8 @@ paths: summary: attach policy to user tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/external/principals: delete: operationId: deleteUserExternalPrincipal @@ -1515,7 +1547,8 @@ paths: - auth - external - experimental - x-accepts: application/json + x-accepts: + - application/json post: operationId: createUserExternalPrincipal parameters: @@ -1574,7 +1607,8 @@ paths: - external - experimental x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /auth/users/{userId}/external/principals/ls: get: operationId: listUserExternalPrincipals @@ -1645,7 +1679,8 @@ paths: - auth - external - experimental - x-accepts: application/json + x-accepts: + - application/json /auth/external/principals: get: operationId: getExternalPrincipal @@ -1689,7 +1724,8 @@ paths: - auth - external - experimental - x-accepts: application/json + x-accepts: + - application/json /auth/groups/{groupId}/policies: get: operationId: listGroupPolicies @@ -1758,7 +1794,8 @@ paths: summary: list group policies tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/groups/{groupId}/policies/{policyId}: delete: operationId: detachPolicyFromGroup @@ -1803,7 +1840,8 @@ paths: summary: detach policy from group tags: - auth - x-accepts: application/json + x-accepts: + - application/json put: operationId: attachPolicyToGroup parameters: @@ -1847,7 +1885,8 @@ paths: summary: attach policy to group tags: - auth - x-accepts: application/json + x-accepts: + - application/json /auth/groups/{groupId}/acl: get: operationId: getGroupACL @@ -1889,7 +1928,8 @@ paths: summary: get ACL of group tags: - auth - x-accepts: application/json + x-accepts: + - application/json post: operationId: setGroupACL parameters: @@ -1933,7 +1973,8 @@ paths: tags: - auth x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories: get: operationId: listRepositories @@ -1989,7 +2030,8 @@ paths: summary: list repositories tags: - repositories - x-accepts: application/json + x-accepts: + - application/json post: operationId: createRepository parameters: @@ -2046,7 +2088,8 @@ paths: tags: - repositories x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}: delete: operationId: deleteRepository @@ -2093,7 +2136,8 @@ paths: summary: delete repository tags: - repositories - x-accepts: application/json + x-accepts: + - application/json get: operationId: getRepository parameters: @@ -2134,7 +2178,8 @@ paths: summary: get repository tags: - repositories - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/metadata: delete: description: | @@ -2175,7 +2220,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json get: operationId: getRepositoryMetadata parameters: @@ -2216,7 +2262,8 @@ paths: summary: get repository metadata tags: - repositories - x-accepts: application/json + x-accepts: + - application/json post: description: | Set repository metadata. This will only add or update the provided keys, and will not remove any existing keys. @@ -2262,7 +2309,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/settings/gc_rules: delete: operationId: deleteGCRules @@ -2305,7 +2353,8 @@ paths: description: Internal Server Error tags: - repositories - x-accepts: application/json + x-accepts: + - application/json get: operationId: getGCRules parameters: @@ -2346,7 +2395,8 @@ paths: summary: get repository GC rules tags: - repositories - x-accepts: application/json + x-accepts: + - application/json put: operationId: setGCRules parameters: @@ -2395,7 +2445,8 @@ paths: tags: - repositories x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/settings/branch_protection: get: operationId: getBranchProtectionRules @@ -2446,7 +2497,8 @@ paths: summary: get branch protection rules tags: - repositories - x-accepts: application/json + x-accepts: + - application/json put: operationId: setBranchProtectionRules parameters: @@ -2518,7 +2570,8 @@ paths: tags: - repositories x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/dump: put: operationId: dumpRefs @@ -2568,7 +2621,8 @@ paths: Deprecated: a new API will introduce long running operations tags: - internal - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/restore: put: operationId: restoreRefs @@ -2621,7 +2675,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/dump: get: operationId: dumpStatus @@ -2676,7 +2731,8 @@ paths: summary: Status of a repository dump task tags: - repositories - x-accepts: application/json + x-accepts: + - application/json post: operationId: dumpSubmit parameters: @@ -2722,7 +2778,8 @@ paths: \ the backup to the object store." tags: - repositories - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/restore: get: operationId: restoreStatus @@ -2777,7 +2834,8 @@ paths: summary: Status of a restore request tags: - repositories - x-accepts: application/json + x-accepts: + - application/json post: operationId: restoreSubmit parameters: @@ -2835,7 +2893,8 @@ paths: tags: - repositories x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/tags: get: operationId: listTags @@ -2904,7 +2963,8 @@ paths: summary: list tags tags: - tags - x-accepts: application/json + x-accepts: + - application/json post: operationId: createTag parameters: @@ -2970,7 +3030,8 @@ paths: tags: - tags x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/tags/{tag}: delete: operationId: deleteTag @@ -3028,7 +3089,8 @@ paths: summary: delete tag tags: - tags - x-accepts: application/json + x-accepts: + - application/json get: operationId: getTag parameters: @@ -3076,7 +3138,8 @@ paths: summary: get tag tags: - tags - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches: get: operationId: listBranches @@ -3145,7 +3208,8 @@ paths: summary: list branches tags: - branches - x-accepts: application/json + x-accepts: + - application/json post: operationId: createBranch parameters: @@ -3211,7 +3275,9 @@ paths: tags: - branches x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json + - text/html /repositories/{repository}/refs/{ref}/commits: get: operationId: logCommits @@ -3338,7 +3404,8 @@ paths: \ all commits." tags: - refs - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/commits: post: operationId: commit @@ -3427,7 +3494,8 @@ paths: tags: - commits x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/commits: post: operationId: CreateCommitRecord @@ -3484,7 +3552,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}: delete: operationId: deleteBranch @@ -3543,7 +3612,8 @@ paths: summary: delete branch tags: - branches - x-accepts: application/json + x-accepts: + - application/json get: operationId: getBranch parameters: @@ -3591,7 +3661,8 @@ paths: summary: get branch tags: - branches - x-accepts: application/json + x-accepts: + - application/json put: operationId: resetBranch parameters: @@ -3654,7 +3725,8 @@ paths: tags: - branches x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/hard_reset: put: description: Relocate branch to refer to ref. Branch must not contain uncommitted @@ -3729,7 +3801,8 @@ paths: summary: hard reset branch tags: - experimental - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/revert: post: operationId: revertBranch @@ -3799,7 +3872,8 @@ paths: tags: - branches x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/cherry-pick: post: operationId: cherryPick @@ -3873,7 +3947,8 @@ paths: tags: - branches x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: get: operationId: findMergeBase @@ -3937,7 +4012,8 @@ paths: summary: find the merge base for 2 references tags: - refs - x-accepts: application/json + x-accepts: + - application/json post: operationId: mergeIntoBranch parameters: @@ -4026,7 +4102,8 @@ paths: tags: - refs x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/diff: get: operationId: diffBranch @@ -4110,7 +4187,8 @@ paths: summary: diff branch tags: - branches - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{leftRef}/diff/{rightRef}: get: operationId: diffRefs @@ -4215,7 +4293,8 @@ paths: summary: diff references tags: - refs - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/commits/{commitId}: get: operationId: getCommit @@ -4264,7 +4343,8 @@ paths: summary: get commit tags: - commits - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{ref}/objects: get: operationId: getObject @@ -4419,7 +4499,9 @@ paths: summary: get object content tags: - objects - x-accepts: application/json + x-accepts: + - application/json + - application/octet-stream head: operationId: headObject parameters: @@ -4516,7 +4598,8 @@ paths: summary: check if object exists tags: - objects - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/staging/pmpu: post: description: | @@ -4591,7 +4674,8 @@ paths: summary: Initiate a multipart upload tags: - experimental - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}: delete: description: Aborts a presign multipart upload. @@ -4664,7 +4748,8 @@ paths: tags: - experimental x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json put: description: Completes a presign multipart upload by assembling the uploaded parts. @@ -4747,7 +4832,8 @@ paths: tags: - experimental x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/staging/backing: get: operationId: getPhysicalAddress @@ -4811,7 +4897,8 @@ paths: summary: generate an address to which the client can upload an object tags: - staging - x-accepts: application/json + x-accepts: + - application/json put: description: | Link the physical address with the path in lakeFS, creating an uncommitted change. @@ -4911,7 +4998,8 @@ paths: tags: - staging x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/import: delete: operationId: importCancel @@ -4976,7 +5064,8 @@ paths: summary: cancel ongoing import tags: - import - x-accepts: application/json + x-accepts: + - application/json get: operationId: importStatus parameters: @@ -5032,7 +5121,8 @@ paths: summary: get import status tags: - import - x-accepts: application/json + x-accepts: + - application/json post: operationId: importStart parameters: @@ -5099,7 +5189,8 @@ paths: tags: - import x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/objects/stage_allowed: get: operationId: uploadObjectPreflight @@ -5159,7 +5250,8 @@ paths: description: Internal Server Error tags: - internal - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/objects: delete: operationId: deleteObject @@ -5226,7 +5318,8 @@ paths: summary: delete object. Missing objects will not return a NotFound error. tags: - objects - x-accepts: application/json + x-accepts: + - application/json post: operationId: uploadObject parameters: @@ -5338,7 +5431,8 @@ paths: - objects x-validation-exclude-body: true x-content-type: multipart/form-data - x-accepts: application/json + x-accepts: + - application/json put: deprecated: true operationId: stageObject @@ -5414,7 +5508,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/objects/delete: post: operationId: deleteObjects @@ -5484,7 +5579,8 @@ paths: tags: - objects x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branches/{branch}/objects/copy: post: operationId: copyObject @@ -5561,7 +5657,8 @@ paths: tags: - objects x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{ref}/objects/stat: get: operationId: statObject @@ -5642,7 +5739,8 @@ paths: summary: get object metadata tags: - objects - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{ref}/objects/underlyingProperties: get: operationId: getUnderlyingProperties @@ -5700,7 +5798,8 @@ paths: summary: get object properties on underlying storage tags: - objects - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{ref}/objects/ls: get: operationId: listObjects @@ -5800,7 +5899,8 @@ paths: summary: list objects under a given prefix tags: - objects - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/refs/{branch}/symlink: post: operationId: createSymlinkFile @@ -5857,7 +5957,8 @@ paths: summary: creates symlink files corresponding to the given directory tags: - internal - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/actions/runs: get: operationId: listRepositoryRuns @@ -5932,7 +6033,8 @@ paths: summary: list runs tags: - actions - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/actions/runs/{run_id}: get: operationId: getRun @@ -5981,7 +6083,8 @@ paths: summary: get a run tags: - actions - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/actions/runs/{run_id}/hooks: get: operationId: listRunHooks @@ -6049,7 +6152,8 @@ paths: summary: list run hooks tags: - actions - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output: get: operationId: getRunHookOutput @@ -6106,7 +6210,9 @@ paths: summary: get run hook output tags: - actions - x-accepts: application/json + x-accepts: + - application/json + - application/octet-stream /repositories/{repository}/metadata/object/{type}/{object_id}: get: operationId: getMetadataObject @@ -6188,7 +6294,9 @@ paths: summary: return a lakeFS metadata object by ID tags: - internal - x-accepts: application/json + x-accepts: + - application/json + - application/octet-stream /repositories/{repository}/metadata/meta_range/{meta_range}: get: operationId: getMetaRange @@ -6244,7 +6352,8 @@ paths: summary: return URI to a meta-range file tags: - metadata - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/metadata/range/{range}: get: operationId: getRange @@ -6300,7 +6409,8 @@ paths: summary: return URI to a range file tags: - metadata - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/gc/rules/set_allowed: get: operationId: setGarbageCollectionRulesPreflight @@ -6338,7 +6448,8 @@ paths: description: Internal Server Error tags: - internal - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/gc/rules: delete: deprecated: true @@ -6376,7 +6487,8 @@ paths: description: Internal Server Error tags: - internal - x-accepts: application/json + x-accepts: + - application/json get: deprecated: true operationId: internalGetGarbageCollectionRules @@ -6417,7 +6529,8 @@ paths: description: Internal Server Error tags: - internal - x-accepts: application/json + x-accepts: + - application/json post: deprecated: true operationId: internalSetGarbageCollectionRules @@ -6461,7 +6574,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/gc/prepare_commits: post: operationId: prepareGarbageCollectionCommits @@ -6509,7 +6623,8 @@ paths: summary: save lists of active commits for garbage collection tags: - internal - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/gc/prepare_uncommited: post: operationId: prepareGarbageCollectionUncommitted @@ -6569,7 +6684,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branch_protection/set_allowed: get: operationId: createBranchProtectionRulePreflight @@ -6613,7 +6729,8 @@ paths: description: Internal Server Error tags: - internal - x-accepts: application/json + x-accepts: + - application/json /repositories/{repository}/branch_protection: delete: deprecated: true @@ -6658,7 +6775,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json get: deprecated: true operationId: internalGetBranchProtectionRules @@ -6702,7 +6820,8 @@ paths: summary: get branch protection rules tags: - internal - x-accepts: application/json + x-accepts: + - application/json post: deprecated: true operationId: internalCreateBranchProtectionRule @@ -6746,7 +6865,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /healthcheck: get: description: check that the API server is up and running @@ -6757,7 +6877,8 @@ paths: security: [] tags: - healthCheck - x-accepts: application/json + x-accepts: + - application/json /config: get: description: retrieve lakeFS configuration @@ -6777,7 +6898,8 @@ paths: description: Unauthorized tags: - config - x-accepts: application/json + x-accepts: + - application/json /config/version: get: deprecated: true @@ -6798,7 +6920,8 @@ paths: description: Unauthorized tags: - internal - x-accepts: application/json + x-accepts: + - application/json /config/storage: get: deprecated: true @@ -6819,7 +6942,8 @@ paths: description: Unauthorized tags: - internal - x-accepts: application/json + x-accepts: + - application/json /config/garbage-collection: get: description: get information of gc settings @@ -6839,7 +6963,8 @@ paths: description: Unauthorized tags: - internal - x-accepts: application/json + x-accepts: + - application/json /statistics: post: operationId: postStatsEvents @@ -6876,7 +7001,8 @@ paths: tags: - internal x-content-type: application/json - x-accepts: application/json + x-accepts: + - application/json /usage-report/summary: get: operationId: getUsageReportSummary @@ -6919,7 +7045,9 @@ paths: summary: get usage report summary tags: - internal - x-accepts: application/json + x-accepts: + - application/json + - application/text components: parameters: PaginationPrefix: @@ -7983,6 +8111,9 @@ components: - errors type: object ErrorNoACL: + example: + no_acl: true + message: message properties: message: description: short message explaining the error @@ -8724,7 +8855,7 @@ components: example: physical_address: physical_address presigned_url: presigned_url - presigned_url_expiry: 0 + presigned_url_expiry: 5 properties: physical_address: type: string @@ -8756,7 +8887,7 @@ components: staging: physical_address: physical_address presigned_url: presigned_url - presigned_url_expiry: 0 + presigned_url_expiry: 5 properties: staging: $ref: '#/components/schemas/StagingLocation' diff --git a/clients/java/build.gradle b/clients/java/build.gradle index 68cacdbaee8..0fc8fc315a8 100644 --- a/clients/java/build.gradle +++ b/clients/java/build.gradle @@ -62,9 +62,9 @@ if(hasProperty('target') && target == 'android') { def task = project.tasks.create "jar${variant.name.capitalize()}", Jar task.description = "Create jar artifact for ${variant.name}" task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - task.destinationDir = project.file("${project.buildDir}/outputs/jar") - task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + task.from variant.javaCompile.destinationDirectory + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" artifacts.add('archives', task) } } @@ -108,18 +108,17 @@ ext { dependencies { implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.10.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' implementation 'com.google.code.gson:gson:2.9.1' - implementation 'io.gsonfire:gson-fire:1.8.5' - implementation 'javax.ws.rs:jsr311-api:1.1.1' - implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' + implementation 'io.gsonfire:gson-fire:1.9.0' + implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3' } javadoc { diff --git a/clients/java/build.sbt b/clients/java/build.sbt index fe19e48efdb..a1cc7f543d9 100644 --- a/clients/java/build.sbt +++ b/clients/java/build.sbt @@ -10,18 +10,17 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.6.5", - "com.squareup.okhttp3" % "okhttp" % "4.10.0", - "com.squareup.okhttp3" % "logging-interceptor" % "4.10.0", + "com.squareup.okhttp3" % "okhttp" % "4.12.0", + "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.12.0", - "javax.ws.rs" % "jsr311-api" % "1.1.1", - "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1", + "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", - "io.gsonfire" % "gson-fire" % "1.8.5" % "compile", + "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", - "org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test", + "org.junit.jupiter" % "junit-jupiter-api" % "5.10.3" % "test", "com.novocode" % "junit-interface" % "0.10" % "test", "org.mockito" % "mockito-core" % "3.12.4" % "test" ) diff --git a/clients/java/gradle/wrapper/gradle-wrapper.jar b/clients/java/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..e6441136f3d 100644 Binary files a/clients/java/gradle/wrapper/gradle-wrapper.jar and b/clients/java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/clients/java/gradle/wrapper/gradle-wrapper.properties b/clients/java/gradle/wrapper/gradle-wrapper.properties index ffed3a254e9..b82aa23a4f0 100644 --- a/clients/java/gradle/wrapper/gradle-wrapper.properties +++ b/clients/java/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/clients/java/gradlew b/clients/java/gradlew index 005bcde0428..9d0ce634cb1 100644 --- a/clients/java/gradlew +++ b/clients/java/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -69,37 +69,35 @@ app_path=$0 # Need this for daisy-chained symlinks. while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum warn () { - echo "$*" +echo "$*" } >&2 die () { - echo - echo "$*" - echo - exit 1 +echo +echo "$*" +echo +exit 1 } >&2 # OS specific support (must be 'true' or 'false'). @@ -108,10 +106,10 @@ msys=false darwin=false nonstop=false case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -119,39 +117,46 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi +fi else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi +fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac fi # Collect all arguments for the java command, stacking in reverse order: @@ -164,46 +169,56 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi # Use "xargs" to parse quoted args. # @@ -225,10 +240,10 @@ set -- \ # eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' exec "$JAVACMD" "$@" diff --git a/clients/java/gradlew.bat b/clients/java/gradlew.bat index 6a68175eb70..25da30dbdee 100644 --- a/clients/java/gradlew.bat +++ b/clients/java/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +34,20 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/clients/java/pom.xml b/clients/java/pom.xml index 6dfe19b304c..46c46aeadb9 100644 --- a/clients/java/pom.xml +++ b/clients/java/pom.xml @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.4.1 enforce-maven @@ -77,12 +77,12 @@ maven-surefire-plugin 2.22.2 - + loggerPath conf/log4j.properties - + -Xms512m -Xmx1500m methods 10 @@ -98,7 +98,7 @@ maven-dependency-plugin - 3.3.0 + 3.6.1 package @@ -129,7 +129,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.5.0 add_sources @@ -160,7 +160,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.6.3 attach-javadocs @@ -183,7 +183,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources @@ -246,7 +246,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.2.1 sign-artifacts @@ -305,16 +305,10 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - - javax.ws.rs - jsr311-api - ${jsr311-api-version} - - - javax.ws.rs - javax.ws.rs-api - ${javax.ws.rs-api-version} + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs-api-version} @@ -329,29 +323,22 @@ ${junit-platform-runner.version} test - - org.mockito - mockito-core - ${mockito-core-version} - test - 1.8 ${java.version} ${java.version} - 1.8.5 - 4.10.0 - 2.9.1 - 3.12.0 + 1.9.0 + 4.12.0 + 2.10.1 + 3.14.0 0.2.6 1.3.5 - 5.9.1 - 1.9.1 - 3.12.4 - 2.1.1 + 5.10.3 + 1.10.0 + 2.1.6 1.1.1 UTF-8 - 2.27.2 + 2.43.0 diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java index 38fd1cbfcd2..4d16290d0ac 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiClient.java @@ -47,6 +47,7 @@ import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -392,14 +393,23 @@ public Authentication getAuthentication(String authName) { return authentications.get(authName); } - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier tokenSupplier) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); return; } } @@ -487,6 +497,19 @@ public void setAWS4Configuration(String accessKey, String secretKey, String regi throw new RuntimeException("No AWS4 authentication configured!"); } + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + /** * Set the User-Agent header's value (by adding to the default header map). * @@ -742,6 +765,30 @@ public List parameterToPairs(String collectionFormat, String name, Collect return params; } + /** + * Formats the specified free-form query parameters to a list of {@code Pair} objects. + * + * @param value The free-form query parameters. + * @return A list of {@code Pair} objects. + */ + public List freeFormParameterToPairs(Object value) { + List params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + final Map valuesMap = (Map) value; + + for (Map.Entry entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + /** * Formats the specified collection path parameter to a string value. * @@ -1180,10 +1227,6 @@ public Call buildCall(String baseUrl, String path, String method, List que * @throws io.lakefs.clients.sdk.ApiException If fail to serialize the request body object */ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException { - // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams - List allQueryParams = new ArrayList(queryParams); - allQueryParams.addAll(collectionQueryParams); - final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); // prepare HTTP request body @@ -1211,10 +1254,12 @@ public Request buildRequest(String baseUrl, String path, String method, List updatedQueryParams = new ArrayList<>(queryParams); + // update parameters with authentication settings - updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); - final Request.Builder reqBuilder = new Request.Builder().url(url); + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); processHeaderParams(headerParams, reqBuilder); processCookieParams(cookieParams, reqBuilder); diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java index 75154e65803..66a603f4f20 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ApiException.java @@ -21,8 +21,10 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + private int code = 0; private Map> responseHeaders = null; private String responseBody = null; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java b/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java index d84c029d5fe..6746332ad07 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/Configuration.java @@ -13,7 +13,7 @@ package io.lakefs.clients.sdk; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Configuration { public static final String VERSION = "0.1.0-SNAPSHOT"; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java b/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java index 99e478a97cf..44dda5cf82b 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/JSON.java @@ -86,7 +86,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java b/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java index 1f33070b256..73bb46383cb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/Pair.java @@ -13,7 +13,7 @@ package io.lakefs.clients.sdk; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Pair { private String name = ""; private String value = ""; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java index 946b24bf46d..e52345447ef 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerConfiguration.java @@ -1,3 +1,16 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package io.lakefs.clients.sdk; import java.util.Map; @@ -5,6 +18,7 @@ /** * Representing a Server configuration. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerConfiguration { public String URL; public String description; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java index d873f9fdf87..5ed0e84a900 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/ServerVariable.java @@ -1,3 +1,16 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + package io.lakefs.clients.sdk; import java.util.HashSet; @@ -5,6 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ServerVariable { public String description; public String defaultValue; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java b/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java index 07be3c7cb0e..cf5f6aefe27 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java index fc4a37a1e97..ec7f6148b78 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java index b524448523e..d931aa33042 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBasicAuth.java @@ -22,8 +22,6 @@ import java.util.Map; import java.util.List; -import java.io.UnsupportedEncodingException; - public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java index e41ac3189ac..ae2cf0f00e7 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/auth/HttpBearerAuth.java @@ -17,13 +17,15 @@ import io.lakefs.clients.sdk.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HttpBearerAuth implements Authentication { private final String scheme; - private String bearerToken; + private Supplier tokenSupplier; public HttpBearerAuth(String scheme) { this.scheme = scheme; @@ -35,7 +37,7 @@ public HttpBearerAuth(String scheme) { * @return The bearer token */ public String getBearerToken() { - return bearerToken; + return tokenSupplier.get(); } /** @@ -44,12 +46,22 @@ public String getBearerToken() { * @param bearerToken The bearer token to send in the Authorization header */ public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier tokenSupplier) { + this.tokenSupplier = tokenSupplier; } @Override public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); if (bearerToken == null) { return; } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java index b114a6bd981..9046a4b3af4 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ACL.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ACL */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ACL { public static final String SERIALIZED_NAME_PERMISSION = "permission"; @SerializedName(SERIALIZED_NAME_PERMISSION) @@ -60,21 +58,19 @@ public ACL() { } public ACL permission(String permission) { - this.permission = permission; return this; } - /** + /** * Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. * @return permission - **/ + */ @javax.annotation.Nonnull public String getPermission() { return permission; } - public void setPermission(String permission) { this.permission = permission; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("permission"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ACL - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ACL + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ACL.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ACL given an JSON string - * - * @param jsonString JSON string - * @return An instance of ACL - * @throws IOException if the JSON string is invalid with respect to ACL - */ + /** + * Create an instance of ACL given an JSON string + * + * @param jsonString JSON string + * @return An instance of ACL + * @throws IOException if the JSON string is invalid with respect to ACL + */ public static ACL fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ACL.class); } - /** - * Convert an instance of ACL to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ACL to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbortPresignMultipartUpload.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbortPresignMultipartUpload.java index 51d0837e791..2b7e15715c0 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbortPresignMultipartUpload.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbortPresignMultipartUpload.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * AbortPresignMultipartUpload */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AbortPresignMultipartUpload { public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) @@ -60,21 +58,19 @@ public AbortPresignMultipartUpload() { } public AbortPresignMultipartUpload physicalAddress(String physicalAddress) { - this.physicalAddress = physicalAddress; return this; } - /** + /** * Get physicalAddress * @return physicalAddress - **/ + */ @javax.annotation.Nonnull public String getPhysicalAddress() { return physicalAddress; } - public void setPhysicalAddress(String physicalAddress) { this.physicalAddress = physicalAddress; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("physical_address"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AbortPresignMultipartUpload - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AbortPresignMultipartUpload + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AbortPresignMultipartUpload.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of AbortPresignMultipartUpload given an JSON string - * - * @param jsonString JSON string - * @return An instance of AbortPresignMultipartUpload - * @throws IOException if the JSON string is invalid with respect to AbortPresignMultipartUpload - */ + /** + * Create an instance of AbortPresignMultipartUpload given an JSON string + * + * @param jsonString JSON string + * @return An instance of AbortPresignMultipartUpload + * @throws IOException if the JSON string is invalid with respect to AbortPresignMultipartUpload + */ public static AbortPresignMultipartUpload fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AbortPresignMultipartUpload.class); } - /** - * Convert an instance of AbortPresignMultipartUpload to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AbortPresignMultipartUpload to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java index c72d060a2e2..a17ac20ef59 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AbstractOpenApiSchema.java @@ -18,12 +18,10 @@ import java.lang.reflect.Type; import java.util.Map; -//import com.fasterxml.jackson.annotation.JsonValue; - /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java index 40e757a7205..96ca0515b90 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AccessKeyCredentials.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * AccessKeyCredentials */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AccessKeyCredentials { public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) @@ -64,42 +62,38 @@ public AccessKeyCredentials() { } public AccessKeyCredentials accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; return this; } - /** + /** * access key ID to set for user for use in integration testing. * @return accessKeyId - **/ + */ @javax.annotation.Nonnull public String getAccessKeyId() { return accessKeyId; } - public void setAccessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; } public AccessKeyCredentials secretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; return this; } - /** + /** * secret access key to set for user for use in integration testing. * @return secretAccessKey - **/ + */ @javax.annotation.Nonnull public String getSecretAccessKey() { return secretAccessKey; } - public void setSecretAccessKey(String secretAccessKey) { this.secretAccessKey = secretAccessKey; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("secret_access_key"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AccessKeyCredentials - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AccessKeyCredentials + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AccessKeyCredentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -263,7 +257,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -302,22 +301,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of AccessKeyCredentials given an JSON string - * - * @param jsonString JSON string - * @return An instance of AccessKeyCredentials - * @throws IOException if the JSON string is invalid with respect to AccessKeyCredentials - */ + /** + * Create an instance of AccessKeyCredentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessKeyCredentials + * @throws IOException if the JSON string is invalid with respect to AccessKeyCredentials + */ public static AccessKeyCredentials fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AccessKeyCredentials.class); } - /** - * Convert an instance of AccessKeyCredentials to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AccessKeyCredentials to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java index 6328801766a..d1a25e7c147 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRun.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * ActionRun */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ActionRun { public static final String SERIALIZED_NAME_RUN_ID = "run_id"; @SerializedName(SERIALIZED_NAME_RUN_ID) @@ -118,6 +116,11 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { return StatusEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_STATUS = "status"; @@ -132,147 +135,133 @@ public ActionRun() { } public ActionRun runId(String runId) { - this.runId = runId; return this; } - /** + /** * Get runId * @return runId - **/ + */ @javax.annotation.Nonnull public String getRunId() { return runId; } - public void setRunId(String runId) { this.runId = runId; } public ActionRun branch(String branch) { - this.branch = branch; return this; } - /** + /** * Get branch * @return branch - **/ + */ @javax.annotation.Nonnull public String getBranch() { return branch; } - public void setBranch(String branch) { this.branch = branch; } public ActionRun startTime(OffsetDateTime startTime) { - this.startTime = startTime; return this; } - /** + /** * Get startTime * @return startTime - **/ + */ @javax.annotation.Nonnull public OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(OffsetDateTime startTime) { this.startTime = startTime; } public ActionRun endTime(OffsetDateTime endTime) { - this.endTime = endTime; return this; } - /** + /** * Get endTime * @return endTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getEndTime() { return endTime; } - public void setEndTime(OffsetDateTime endTime) { this.endTime = endTime; } public ActionRun eventType(String eventType) { - this.eventType = eventType; return this; } - /** + /** * Get eventType * @return eventType - **/ + */ @javax.annotation.Nonnull public String getEventType() { return eventType; } - public void setEventType(String eventType) { this.eventType = eventType; } public ActionRun status(StatusEnum status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nonnull public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } public ActionRun commitId(String commitId) { - this.commitId = commitId; return this; } - /** + /** * Get commitId * @return commitId - **/ + */ @javax.annotation.Nonnull public String getCommitId() { return commitId; } - public void setCommitId(String commitId) { this.commitId = commitId; } @@ -399,12 +388,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("commit_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ActionRun - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ActionRun + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ActionRun.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -431,6 +420,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); if (!jsonObj.get("commit_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `commit_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("commit_id").toString())); } @@ -464,7 +455,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -503,22 +499,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ActionRun given an JSON string - * - * @param jsonString JSON string - * @return An instance of ActionRun - * @throws IOException if the JSON string is invalid with respect to ActionRun - */ + /** + * Create an instance of ActionRun given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActionRun + * @throws IOException if the JSON string is invalid with respect to ActionRun + */ public static ActionRun fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ActionRun.class); } - /** - * Convert an instance of ActionRun to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ActionRun to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java index 28d11cda964..29475fe674c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ActionRunList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * ActionRunList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ActionRunList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public ActionRunList() { } public ActionRunList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public ActionRunList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public ActionRunList addResultsItem(ActionRun resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ActionRunList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ActionRunList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ActionRunList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ActionRunList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ActionRunList - * @throws IOException if the JSON string is invalid with respect to ActionRunList - */ + /** + * Create an instance of ActionRunList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActionRunList + * @throws IOException if the JSON string is invalid with respect to ActionRunList + */ public static ActionRunList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ActionRunList.class); } - /** - * Convert an instance of ActionRunList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ActionRunList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java index 72ca5c74681..f75e5c558ab 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthCapabilities.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * AuthCapabilities */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AuthCapabilities { public static final String SERIALIZED_NAME_INVITE_USER = "invite_user"; @SerializedName(SERIALIZED_NAME_INVITE_USER) @@ -64,42 +62,38 @@ public AuthCapabilities() { } public AuthCapabilities inviteUser(Boolean inviteUser) { - this.inviteUser = inviteUser; return this; } - /** + /** * Get inviteUser * @return inviteUser - **/ + */ @javax.annotation.Nullable public Boolean getInviteUser() { return inviteUser; } - public void setInviteUser(Boolean inviteUser) { this.inviteUser = inviteUser; } public AuthCapabilities forgotPassword(Boolean forgotPassword) { - this.forgotPassword = forgotPassword; return this; } - /** + /** * Get forgotPassword * @return forgotPassword - **/ + */ @javax.annotation.Nullable public Boolean getForgotPassword() { return forgotPassword; } - public void setForgotPassword(Boolean forgotPassword) { this.forgotPassword = forgotPassword; } @@ -205,12 +199,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthCapabilities - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthCapabilities + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AuthCapabilities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -248,7 +242,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -287,22 +286,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of AuthCapabilities given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthCapabilities - * @throws IOException if the JSON string is invalid with respect to AuthCapabilities - */ + /** + * Create an instance of AuthCapabilities given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthCapabilities + * @throws IOException if the JSON string is invalid with respect to AuthCapabilities + */ public static AuthCapabilities fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AuthCapabilities.class); } - /** - * Convert an instance of AuthCapabilities to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AuthCapabilities to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java index 47c4d874a19..9621c282997 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/AuthenticationToken.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * AuthenticationToken */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class AuthenticationToken { public static final String SERIALIZED_NAME_TOKEN = "token"; @SerializedName(SERIALIZED_NAME_TOKEN) @@ -64,42 +62,38 @@ public AuthenticationToken() { } public AuthenticationToken token(String token) { - this.token = token; return this; } - /** + /** * a JWT token that could be used to authenticate requests * @return token - **/ + */ @javax.annotation.Nonnull public String getToken() { return token; } - public void setToken(String token) { this.token = token; } public AuthenticationToken tokenExpiration(Long tokenExpiration) { - this.tokenExpiration = tokenExpiration; return this; } - /** + /** * Unix Epoch in seconds * @return tokenExpiration - **/ + */ @javax.annotation.Nullable public Long getTokenExpiration() { return tokenExpiration; } - public void setTokenExpiration(Long tokenExpiration) { this.tokenExpiration = tokenExpiration; } @@ -206,12 +200,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("token"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to AuthenticationToken - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthenticationToken + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!AuthenticationToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -259,7 +253,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -298,22 +297,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of AuthenticationToken given an JSON string - * - * @param jsonString JSON string - * @return An instance of AuthenticationToken - * @throws IOException if the JSON string is invalid with respect to AuthenticationToken - */ + /** + * Create an instance of AuthenticationToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthenticationToken + * @throws IOException if the JSON string is invalid with respect to AuthenticationToken + */ public static AuthenticationToken fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, AuthenticationToken.class); } - /** - * Convert an instance of AuthenticationToken to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of AuthenticationToken to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java index 1b80f7fdbac..b6475ed0220 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * BranchCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class BranchCreation { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -68,63 +66,57 @@ public BranchCreation() { } public BranchCreation name(String name) { - this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; } - public void setName(String name) { this.name = name; } public BranchCreation source(String source) { - this.source = source; return this; } - /** + /** * Get source * @return source - **/ + */ @javax.annotation.Nonnull public String getSource() { return source; } - public void setSource(String source) { this.source = source; } public BranchCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -235,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("source"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BranchCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BranchCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BranchCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -291,7 +283,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -330,22 +327,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of BranchCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of BranchCreation - * @throws IOException if the JSON string is invalid with respect to BranchCreation - */ + /** + * Create an instance of BranchCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of BranchCreation + * @throws IOException if the JSON string is invalid with respect to BranchCreation + */ public static BranchCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BranchCreation.class); } - /** - * Convert an instance of BranchCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BranchCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java index 6d37a6e7c93..78058bff62a 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/BranchProtectionRule.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * BranchProtectionRule */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class BranchProtectionRule { public static final String SERIALIZED_NAME_PATTERN = "pattern"; @SerializedName(SERIALIZED_NAME_PATTERN) @@ -60,21 +58,19 @@ public BranchProtectionRule() { } public BranchProtectionRule pattern(String pattern) { - this.pattern = pattern; return this; } - /** + /** * fnmatch pattern for the branch name, supporting * and ? wildcards * @return pattern - **/ + */ @javax.annotation.Nonnull public String getPattern() { return pattern; } - public void setPattern(String pattern) { this.pattern = pattern; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pattern"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BranchProtectionRule - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BranchProtectionRule + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BranchProtectionRule.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of BranchProtectionRule given an JSON string - * - * @param jsonString JSON string - * @return An instance of BranchProtectionRule - * @throws IOException if the JSON string is invalid with respect to BranchProtectionRule - */ + /** + * Create an instance of BranchProtectionRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of BranchProtectionRule + * @throws IOException if the JSON string is invalid with respect to BranchProtectionRule + */ public static BranchProtectionRule fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BranchProtectionRule.class); } - /** - * Convert an instance of BranchProtectionRule to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BranchProtectionRule to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java index 720d406072c..7b64f2257fd 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CherryPickCreation.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * CherryPickCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CherryPickCreation { public static final String SERIALIZED_NAME_REF = "ref"; @SerializedName(SERIALIZED_NAME_REF) @@ -73,84 +71,76 @@ public CherryPickCreation() { } public CherryPickCreation ref(String ref) { - this.ref = ref; return this; } - /** + /** * the commit to cherry-pick, given by a ref * @return ref - **/ + */ @javax.annotation.Nonnull public String getRef() { return ref; } - public void setRef(String ref) { this.ref = ref; } public CherryPickCreation parentNumber(Integer parentNumber) { - this.parentNumber = parentNumber; return this; } - /** + /** * When cherry-picking a merge commit, the parent number (starting from 1) with which to perform the diff. The default branch is parent 1. * @return parentNumber - **/ + */ @javax.annotation.Nullable public Integer getParentNumber() { return parentNumber; } - public void setParentNumber(Integer parentNumber) { this.parentNumber = parentNumber; } public CherryPickCreation commitOverrides(CommitOverrides commitOverrides) { - this.commitOverrides = commitOverrides; return this; } - /** + /** * Get commitOverrides * @return commitOverrides - **/ + */ @javax.annotation.Nullable public CommitOverrides getCommitOverrides() { return commitOverrides; } - public void setCommitOverrides(CommitOverrides commitOverrides) { this.commitOverrides = commitOverrides; } public CherryPickCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -263,12 +253,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ref"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CherryPickCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CherryPickCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CherryPickCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -320,7 +310,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -359,22 +354,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CherryPickCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of CherryPickCreation - * @throws IOException if the JSON string is invalid with respect to CherryPickCreation - */ + /** + * Create an instance of CherryPickCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of CherryPickCreation + * @throws IOException if the JSON string is invalid with respect to CherryPickCreation + */ public static CherryPickCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CherryPickCreation.class); } - /** - * Convert an instance of CherryPickCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CherryPickCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java index 7cc3a6743d2..d3818f0b049 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommPrefsInput.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * CommPrefsInput */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CommPrefsInput { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -68,63 +66,57 @@ public CommPrefsInput() { } public CommPrefsInput email(String email) { - this.email = email; return this; } - /** + /** * the provided email * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } public CommPrefsInput featureUpdates(Boolean featureUpdates) { - this.featureUpdates = featureUpdates; return this; } - /** + /** * user preference to receive feature updates * @return featureUpdates - **/ + */ @javax.annotation.Nonnull public Boolean getFeatureUpdates() { return featureUpdates; } - public void setFeatureUpdates(Boolean featureUpdates) { this.featureUpdates = featureUpdates; } public CommPrefsInput securityUpdates(Boolean securityUpdates) { - this.securityUpdates = securityUpdates; return this; } - /** + /** * user preference to receive security updates * @return securityUpdates - **/ + */ @javax.annotation.Nonnull public Boolean getSecurityUpdates() { return securityUpdates; } - public void setSecurityUpdates(Boolean securityUpdates) { this.securityUpdates = securityUpdates; } @@ -235,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("securityUpdates"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommPrefsInput - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommPrefsInput + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CommPrefsInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -288,7 +280,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -327,22 +324,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CommPrefsInput given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommPrefsInput - * @throws IOException if the JSON string is invalid with respect to CommPrefsInput - */ + /** + * Create an instance of CommPrefsInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommPrefsInput + * @throws IOException if the JSON string is invalid with respect to CommPrefsInput + */ public static CommPrefsInput fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CommPrefsInput.class); } - /** - * Convert an instance of CommPrefsInput to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CommPrefsInput to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java index b33fc183ced..0866df91c0e 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Commit.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * Commit */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Commit { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -96,28 +94,25 @@ public Commit() { } public Commit id(String id) { - this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public Commit parents(List parents) { - this.parents = parents; return this; } @@ -130,107 +125,97 @@ public Commit addParentsItem(String parentsItem) { return this; } - /** + /** * Get parents * @return parents - **/ + */ @javax.annotation.Nonnull public List getParents() { return parents; } - public void setParents(List parents) { this.parents = parents; } public Commit committer(String committer) { - this.committer = committer; return this; } - /** + /** * Get committer * @return committer - **/ + */ @javax.annotation.Nonnull public String getCommitter() { return committer; } - public void setCommitter(String committer) { this.committer = committer; } public Commit message(String message) { - this.message = message; return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public Commit creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } public Commit metaRangeId(String metaRangeId) { - this.metaRangeId = metaRangeId; return this; } - /** + /** * Get metaRangeId * @return metaRangeId - **/ + */ @javax.annotation.Nonnull public String getMetaRangeId() { return metaRangeId; } - public void setMetaRangeId(String metaRangeId) { this.metaRangeId = metaRangeId; } public Commit metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -243,60 +228,55 @@ public Commit putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } public Commit generation(Long generation) { - this.generation = generation; return this; } - /** + /** * Get generation * @return generation - **/ + */ @javax.annotation.Nullable public Long getGeneration() { return generation; } - public void setGeneration(Long generation) { this.generation = generation; } public Commit version(Integer version) { - this.version = version; return this; } - /** + /** * Get version * minimum: 0 * maximum: 1 * @return version - **/ + */ @javax.annotation.Nullable public Integer getVersion() { return version; } - public void setVersion(Integer version) { this.version = version; } @@ -429,12 +409,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("meta_range_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Commit - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Commit + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Commit.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -497,7 +477,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -536,22 +521,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Commit given an JSON string - * - * @param jsonString JSON string - * @return An instance of Commit - * @throws IOException if the JSON string is invalid with respect to Commit - */ + /** + * Create an instance of Commit given an JSON string + * + * @param jsonString JSON string + * @return An instance of Commit + * @throws IOException if the JSON string is invalid with respect to Commit + */ public static Commit fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Commit.class); } - /** - * Convert an instance of Commit to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Commit to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java index 2cd000671f7..8e33c8d4702 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitCreation.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * CommitCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CommitCreation { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -78,28 +76,25 @@ public CommitCreation() { } public CommitCreation message(String message) { - this.message = message; return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public CommitCreation metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -112,79 +107,72 @@ public CommitCreation putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } public CommitCreation date(Long date) { - this.date = date; return this; } - /** + /** * set date to override creation date in the commit (Unix Epoch in seconds) * @return date - **/ + */ @javax.annotation.Nullable public Long getDate() { return date; } - public void setDate(Long date) { this.date = date; } public CommitCreation allowEmpty(Boolean allowEmpty) { - this.allowEmpty = allowEmpty; return this; } - /** + /** * sets whether a commit can contain no changes * @return allowEmpty - **/ + */ @javax.annotation.Nullable public Boolean getAllowEmpty() { return allowEmpty; } - public void setAllowEmpty(Boolean allowEmpty) { this.allowEmpty = allowEmpty; } public CommitCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -300,12 +288,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("message"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommitCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CommitCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -353,7 +341,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -392,22 +385,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CommitCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommitCreation - * @throws IOException if the JSON string is invalid with respect to CommitCreation - */ + /** + * Create an instance of CommitCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitCreation + * @throws IOException if the JSON string is invalid with respect to CommitCreation + */ public static CommitCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CommitCreation.class); } - /** - * Convert an instance of CommitCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CommitCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java index 07a18b89aa8..8f31c765b6c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * CommitList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CommitList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public CommitList() { } public CommitList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public CommitList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public CommitList addResultsItem(Commit resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommitList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CommitList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CommitList given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommitList - * @throws IOException if the JSON string is invalid with respect to CommitList - */ + /** + * Create an instance of CommitList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitList + * @throws IOException if the JSON string is invalid with respect to CommitList + */ public static CommitList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CommitList.class); } - /** - * Convert an instance of CommitList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CommitList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitOverrides.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitOverrides.java index c70842c779a..e244c2252a7 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitOverrides.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitOverrides.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * CommitOverrides */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CommitOverrides { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -66,28 +64,25 @@ public CommitOverrides() { } public CommitOverrides message(String message) { - this.message = message; return this; } - /** + /** * replace the commit message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public CommitOverrides metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -100,16 +95,15 @@ public CommitOverrides putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * replace the metadata of the commit * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } @@ -215,12 +209,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommitOverrides - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitOverrides + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CommitOverrides.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -261,7 +255,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -300,22 +299,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CommitOverrides given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommitOverrides - * @throws IOException if the JSON string is invalid with respect to CommitOverrides - */ + /** + * Create an instance of CommitOverrides given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitOverrides + * @throws IOException if the JSON string is invalid with respect to CommitOverrides + */ public static CommitOverrides fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CommitOverrides.class); } - /** - * Convert an instance of CommitOverrides to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CommitOverrides to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitRecordCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitRecordCreation.java index 4e9201bbac3..eee5d16f576 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitRecordCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CommitRecordCreation.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * CommitRecordCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CommitRecordCreation { public static final String SERIALIZED_NAME_COMMIT_ID = "commit_id"; @SerializedName(SERIALIZED_NAME_COMMIT_ID) @@ -100,135 +98,122 @@ public CommitRecordCreation() { } public CommitRecordCreation commitId(String commitId) { - this.commitId = commitId; return this; } - /** + /** * id of the commit record * @return commitId - **/ + */ @javax.annotation.Nonnull public String getCommitId() { return commitId; } - public void setCommitId(String commitId) { this.commitId = commitId; } public CommitRecordCreation version(Integer version) { - this.version = version; return this; } - /** + /** * version of the commit record * minimum: 0 * maximum: 1 * @return version - **/ + */ @javax.annotation.Nonnull public Integer getVersion() { return version; } - public void setVersion(Integer version) { this.version = version; } public CommitRecordCreation committer(String committer) { - this.committer = committer; return this; } - /** + /** * committer of the commit record * @return committer - **/ + */ @javax.annotation.Nonnull public String getCommitter() { return committer; } - public void setCommitter(String committer) { this.committer = committer; } public CommitRecordCreation message(String message) { - this.message = message; return this; } - /** + /** * message of the commit record * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public CommitRecordCreation metarangeId(String metarangeId) { - this.metarangeId = metarangeId; return this; } - /** + /** * metarange_id of the commit record * @return metarangeId - **/ + */ @javax.annotation.Nonnull public String getMetarangeId() { return metarangeId; } - public void setMetarangeId(String metarangeId) { this.metarangeId = metarangeId; } public CommitRecordCreation creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } public CommitRecordCreation parents(List parents) { - this.parents = parents; return this; } @@ -241,23 +226,21 @@ public CommitRecordCreation addParentsItem(String parentsItem) { return this; } - /** + /** * parents of the commit record * @return parents - **/ + */ @javax.annotation.Nonnull public List getParents() { return parents; } - public void setParents(List parents) { this.parents = parents; } public CommitRecordCreation metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -270,58 +253,53 @@ public CommitRecordCreation putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * metadata of the commit record * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } public CommitRecordCreation generation(Long generation) { - this.generation = generation; return this; } - /** + /** * generation of the commit record * @return generation - **/ + */ @javax.annotation.Nonnull public Long getGeneration() { return generation; } - public void setGeneration(Long generation) { this.generation = generation; } public CommitRecordCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -459,12 +437,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("generation"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CommitRecordCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommitRecordCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CommitRecordCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -527,7 +505,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -566,22 +549,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CommitRecordCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of CommitRecordCreation - * @throws IOException if the JSON string is invalid with respect to CommitRecordCreation - */ + /** + * Create an instance of CommitRecordCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommitRecordCreation + * @throws IOException if the JSON string is invalid with respect to CommitRecordCreation + */ public static CommitRecordCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CommitRecordCreation.class); } - /** - * Convert an instance of CommitRecordCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CommitRecordCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CompletePresignMultipartUpload.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CompletePresignMultipartUpload.java index 5b700352b08..1b018fc3c74 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CompletePresignMultipartUpload.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CompletePresignMultipartUpload.java @@ -42,12 +42,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -55,7 +53,7 @@ /** * CompletePresignMultipartUpload */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CompletePresignMultipartUpload { public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) @@ -77,28 +75,25 @@ public CompletePresignMultipartUpload() { } public CompletePresignMultipartUpload physicalAddress(String physicalAddress) { - this.physicalAddress = physicalAddress; return this; } - /** + /** * Get physicalAddress * @return physicalAddress - **/ + */ @javax.annotation.Nonnull public String getPhysicalAddress() { return physicalAddress; } - public void setPhysicalAddress(String physicalAddress) { this.physicalAddress = physicalAddress; } public CompletePresignMultipartUpload parts(List parts) { - this.parts = parts; return this; } @@ -111,23 +106,21 @@ public CompletePresignMultipartUpload addPartsItem(UploadPart partsItem) { return this; } - /** + /** * List of uploaded parts, should be ordered by ascending part number * @return parts - **/ + */ @javax.annotation.Nonnull public List getParts() { return parts; } - public void setParts(List parts) { this.parts = parts; } public CompletePresignMultipartUpload userMetadata(Map userMetadata) { - this.userMetadata = userMetadata; return this; } @@ -140,37 +133,34 @@ public CompletePresignMultipartUpload putUserMetadataItem(String key, String use return this; } - /** + /** * Get userMetadata * @return userMetadata - **/ + */ @javax.annotation.Nullable public Map getUserMetadata() { return userMetadata; } - public void setUserMetadata(Map userMetadata) { this.userMetadata = userMetadata; } public CompletePresignMultipartUpload contentType(String contentType) { - this.contentType = contentType; return this; } - /** + /** * Object media type * @return contentType - **/ + */ @javax.annotation.Nullable public String getContentType() { return contentType; } - public void setContentType(String contentType) { this.contentType = contentType; } @@ -284,12 +274,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("parts"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CompletePresignMultipartUpload - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CompletePresignMultipartUpload + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CompletePresignMultipartUpload.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -350,7 +340,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -389,22 +384,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CompletePresignMultipartUpload given an JSON string - * - * @param jsonString JSON string - * @return An instance of CompletePresignMultipartUpload - * @throws IOException if the JSON string is invalid with respect to CompletePresignMultipartUpload - */ + /** + * Create an instance of CompletePresignMultipartUpload given an JSON string + * + * @param jsonString JSON string + * @return An instance of CompletePresignMultipartUpload + * @throws IOException if the JSON string is invalid with respect to CompletePresignMultipartUpload + */ public static CompletePresignMultipartUpload fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CompletePresignMultipartUpload.class); } - /** - * Convert an instance of CompletePresignMultipartUpload to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CompletePresignMultipartUpload to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Config.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Config.java index 296d9134df1..40efa328ec2 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Config.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Config.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * Config */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Config { public static final String SERIALIZED_NAME_VERSION_CONFIG = "version_config"; @SerializedName(SERIALIZED_NAME_VERSION_CONFIG) @@ -66,42 +64,38 @@ public Config() { } public Config versionConfig(VersionConfig versionConfig) { - this.versionConfig = versionConfig; return this; } - /** + /** * Get versionConfig * @return versionConfig - **/ + */ @javax.annotation.Nullable public VersionConfig getVersionConfig() { return versionConfig; } - public void setVersionConfig(VersionConfig versionConfig) { this.versionConfig = versionConfig; } public Config storageConfig(StorageConfig storageConfig) { - this.storageConfig = storageConfig; return this; } - /** + /** * Get storageConfig * @return storageConfig - **/ + */ @javax.annotation.Nullable public StorageConfig getStorageConfig() { return storageConfig; } - public void setStorageConfig(StorageConfig storageConfig) { this.storageConfig = storageConfig; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Config - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Config + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Config.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -258,7 +252,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -297,22 +296,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Config given an JSON string - * - * @param jsonString JSON string - * @return An instance of Config - * @throws IOException if the JSON string is invalid with respect to Config - */ + /** + * Create an instance of Config given an JSON string + * + * @param jsonString JSON string + * @return An instance of Config + * @throws IOException if the JSON string is invalid with respect to Config + */ public static Config fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Config.class); } - /** - * Convert an instance of Config to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Config to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java index 59b4afdd3c2..c99a658e2c1 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Credentials.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Credentials */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Credentials { public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) @@ -64,42 +62,38 @@ public Credentials() { } public Credentials accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; return this; } - /** + /** * Get accessKeyId * @return accessKeyId - **/ + */ @javax.annotation.Nonnull public String getAccessKeyId() { return accessKeyId; } - public void setAccessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; } public Credentials creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("creation_date"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Credentials - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Credentials + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Credentials.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -260,7 +254,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -299,22 +298,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Credentials given an JSON string - * - * @param jsonString JSON string - * @return An instance of Credentials - * @throws IOException if the JSON string is invalid with respect to Credentials - */ + /** + * Create an instance of Credentials given an JSON string + * + * @param jsonString JSON string + * @return An instance of Credentials + * @throws IOException if the JSON string is invalid with respect to Credentials + */ public static Credentials fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Credentials.class); } - /** - * Convert an instance of Credentials to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Credentials to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java index 5ff00a3eb9d..c8fa1522368 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * CredentialsList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CredentialsList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public CredentialsList() { } public CredentialsList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public CredentialsList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public CredentialsList addResultsItem(Credentials resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CredentialsList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialsList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CredentialsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CredentialsList given an JSON string - * - * @param jsonString JSON string - * @return An instance of CredentialsList - * @throws IOException if the JSON string is invalid with respect to CredentialsList - */ + /** + * Create an instance of CredentialsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsList + * @throws IOException if the JSON string is invalid with respect to CredentialsList + */ public static CredentialsList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CredentialsList.class); } - /** - * Convert an instance of CredentialsList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CredentialsList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java index e857102ccd0..1da68287a71 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CredentialsWithSecret.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * CredentialsWithSecret */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CredentialsWithSecret { public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) @@ -68,63 +66,57 @@ public CredentialsWithSecret() { } public CredentialsWithSecret accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; return this; } - /** + /** * Get accessKeyId * @return accessKeyId - **/ + */ @javax.annotation.Nonnull public String getAccessKeyId() { return accessKeyId; } - public void setAccessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; } public CredentialsWithSecret secretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; return this; } - /** + /** * Get secretAccessKey * @return secretAccessKey - **/ + */ @javax.annotation.Nonnull public String getSecretAccessKey() { return secretAccessKey; } - public void setSecretAccessKey(String secretAccessKey) { this.secretAccessKey = secretAccessKey; } public CredentialsWithSecret creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } @@ -236,12 +228,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("creation_date"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CredentialsWithSecret - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CredentialsWithSecret + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CredentialsWithSecret.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -292,7 +284,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -331,22 +328,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CredentialsWithSecret given an JSON string - * - * @param jsonString JSON string - * @return An instance of CredentialsWithSecret - * @throws IOException if the JSON string is invalid with respect to CredentialsWithSecret - */ + /** + * Create an instance of CredentialsWithSecret given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialsWithSecret + * @throws IOException if the JSON string is invalid with respect to CredentialsWithSecret + */ public static CredentialsWithSecret fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CredentialsWithSecret.class); } - /** - * Convert an instance of CredentialsWithSecret to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CredentialsWithSecret to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java index 437c8c7055a..3202bc45c92 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/CurrentUser.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * CurrentUser */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class CurrentUser { public static final String SERIALIZED_NAME_USER = "user"; @SerializedName(SERIALIZED_NAME_USER) @@ -61,21 +59,19 @@ public CurrentUser() { } public CurrentUser user(User user) { - this.user = user; return this; } - /** + /** * Get user * @return user - **/ + */ @javax.annotation.Nonnull public User getUser() { return user; } - public void setUser(User user) { this.user = user; } @@ -179,12 +175,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("user"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to CurrentUser - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CurrentUser + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!CurrentUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of CurrentUser given an JSON string - * - * @param jsonString JSON string - * @return An instance of CurrentUser - * @throws IOException if the JSON string is invalid with respect to CurrentUser - */ + /** + * Create an instance of CurrentUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of CurrentUser + * @throws IOException if the JSON string is invalid with respect to CurrentUser + */ public static CurrentUser fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, CurrentUser.class); } - /** - * Convert an instance of CurrentUser to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of CurrentUser to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java index 140ee3594ab..e8bd353577c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Diff */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Diff { /** * Gets or Sets type @@ -103,6 +101,11 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { return TypeEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_TYPE = "type"; @@ -158,6 +161,11 @@ public PathTypeEnum read(final JsonReader jsonReader) throws IOException { return PathTypeEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PathTypeEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_PATH_TYPE = "path_type"; @@ -172,84 +180,76 @@ public Diff() { } public Diff type(TypeEnum type) { - this.type = type; return this; } - /** + /** * Get type * @return type - **/ + */ @javax.annotation.Nonnull public TypeEnum getType() { return type; } - public void setType(TypeEnum type) { this.type = type; } public Diff path(String path) { - this.path = path; return this; } - /** + /** * Get path * @return path - **/ + */ @javax.annotation.Nonnull public String getPath() { return path; } - public void setPath(String path) { this.path = path; } public Diff pathType(PathTypeEnum pathType) { - this.pathType = pathType; return this; } - /** + /** * Get pathType * @return pathType - **/ + */ @javax.annotation.Nonnull public PathTypeEnum getPathType() { return pathType; } - public void setPathType(PathTypeEnum pathType) { this.pathType = pathType; } public Diff sizeBytes(Long sizeBytes) { - this.sizeBytes = sizeBytes; return this; } - /** + /** * represents the size of the added/changed/deleted entry * @return sizeBytes - **/ + */ @javax.annotation.Nullable public Long getSizeBytes() { return sizeBytes; } - public void setSizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; } @@ -364,12 +364,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("path_type"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Diff - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Diff + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Diff.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -387,12 +387,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); } if (!jsonObj.get("path_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path_type").toString())); } + // validate the required field `path_type` + PathTypeEnum.validateJsonElement(jsonObj.get("path_type")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -423,7 +427,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -462,22 +471,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Diff given an JSON string - * - * @param jsonString JSON string - * @return An instance of Diff - * @throws IOException if the JSON string is invalid with respect to Diff - */ + /** + * Create an instance of Diff given an JSON string + * + * @param jsonString JSON string + * @return An instance of Diff + * @throws IOException if the JSON string is invalid with respect to Diff + */ public static Diff fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Diff.class); } - /** - * Convert an instance of Diff to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Diff to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java index 650ae20f88f..9c6b1d7fa9c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/DiffList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * DiffList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class DiffList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public DiffList() { } public DiffList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public DiffList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public DiffList addResultsItem(Diff resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DiffList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DiffList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DiffList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of DiffList given an JSON string - * - * @param jsonString JSON string - * @return An instance of DiffList - * @throws IOException if the JSON string is invalid with respect to DiffList - */ + /** + * Create an instance of DiffList given an JSON string + * + * @param jsonString JSON string + * @return An instance of DiffList + * @throws IOException if the JSON string is invalid with respect to DiffList + */ public static DiffList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DiffList.class); } - /** - * Convert an instance of DiffList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DiffList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java index 27e98359617..d95eda8bfa6 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Error.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Error */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Error { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -60,21 +58,19 @@ public Error() { } public Error message(String message) { - this.message = message; return this; } - /** + /** * short message explaining the error * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("message"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Error - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Error + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Error.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Error given an JSON string - * - * @param jsonString JSON string - * @return An instance of Error - * @throws IOException if the JSON string is invalid with respect to Error - */ + /** + * Create an instance of Error given an JSON string + * + * @param jsonString JSON string + * @return An instance of Error + * @throws IOException if the JSON string is invalid with respect to Error + */ public static Error fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Error.class); } - /** - * Convert an instance of Error to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Error to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java index bb9b47e0d57..14c886e2b0e 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ErrorNoACL.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ErrorNoACL */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ErrorNoACL { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -64,42 +62,38 @@ public ErrorNoACL() { } public ErrorNoACL message(String message) { - this.message = message; return this; } - /** + /** * short message explaining the error * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public ErrorNoACL noAcl(Boolean noAcl) { - this.noAcl = noAcl; return this; } - /** + /** * true if the group exists but has no ACL * @return noAcl - **/ + */ @javax.annotation.Nullable public Boolean getNoAcl() { return noAcl; } - public void setNoAcl(Boolean noAcl) { this.noAcl = noAcl; } @@ -206,12 +200,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("message"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ErrorNoACL - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorNoACL + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ErrorNoACL.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -259,7 +253,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -298,22 +297,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ErrorNoACL given an JSON string - * - * @param jsonString JSON string - * @return An instance of ErrorNoACL - * @throws IOException if the JSON string is invalid with respect to ErrorNoACL - */ + /** + * Create an instance of ErrorNoACL given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorNoACL + * @throws IOException if the JSON string is invalid with respect to ErrorNoACL + */ public static ErrorNoACL fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ErrorNoACL.class); } - /** - * Convert an instance of ErrorNoACL to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ErrorNoACL to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalLoginInformation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalLoginInformation.java index ae63343c140..05bd18f213f 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalLoginInformation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalLoginInformation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ExternalLoginInformation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ExternalLoginInformation { public static final String SERIALIZED_NAME_TOKEN_EXPIRATION_DURATION = "token_expiration_duration"; @SerializedName(SERIALIZED_NAME_TOKEN_EXPIRATION_DURATION) @@ -64,42 +62,38 @@ public ExternalLoginInformation() { } public ExternalLoginInformation tokenExpirationDuration(Integer tokenExpirationDuration) { - this.tokenExpirationDuration = tokenExpirationDuration; return this; } - /** + /** * Get tokenExpirationDuration * @return tokenExpirationDuration - **/ + */ @javax.annotation.Nullable public Integer getTokenExpirationDuration() { return tokenExpirationDuration; } - public void setTokenExpirationDuration(Integer tokenExpirationDuration) { this.tokenExpirationDuration = tokenExpirationDuration; } public ExternalLoginInformation identityRequest(Object identityRequest) { - this.identityRequest = identityRequest; return this; } - /** + /** * Get identityRequest * @return identityRequest - **/ + */ @javax.annotation.Nonnull public Object getIdentityRequest() { return identityRequest; } - public void setIdentityRequest(Object identityRequest) { this.identityRequest = identityRequest; } @@ -206,12 +200,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("identityRequest"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExternalLoginInformation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExternalLoginInformation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ExternalLoginInformation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -256,7 +250,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -295,22 +294,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ExternalLoginInformation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExternalLoginInformation - * @throws IOException if the JSON string is invalid with respect to ExternalLoginInformation - */ + /** + * Create an instance of ExternalLoginInformation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExternalLoginInformation + * @throws IOException if the JSON string is invalid with respect to ExternalLoginInformation + */ public static ExternalLoginInformation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ExternalLoginInformation.class); } - /** - * Convert an instance of ExternalLoginInformation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ExternalLoginInformation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipal.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipal.java index df201f1b84e..dfe9c243655 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipal.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipal.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * ExternalPrincipal */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ExternalPrincipal { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -65,55 +63,50 @@ public class ExternalPrincipal { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private List> settings; + private List> settings = new ArrayList<>(); public ExternalPrincipal() { } public ExternalPrincipal id(String id) { - this.id = id; return this; } - /** + /** * A unique identifier for the external principal i.e aws:sts::123:assumed-role/role-name * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public ExternalPrincipal userId(String userId) { - this.userId = userId; return this; } - /** + /** * lakeFS user ID to associate with an external principal. * @return userId - **/ + */ @javax.annotation.Nonnull public String getUserId() { return userId; } - public void setUserId(String userId) { this.userId = userId; } public ExternalPrincipal settings(List> settings) { - this.settings = settings; return this; } @@ -126,16 +119,15 @@ public ExternalPrincipal addSettingsItem(Map settingsItem) { return this; } - /** + /** * Get settings * @return settings - **/ + */ @javax.annotation.Nullable public List> getSettings() { return settings; } - public void setSettings(List> settings) { this.settings = settings; } @@ -246,12 +238,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("user_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExternalPrincipal - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExternalPrincipal + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ExternalPrincipal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -306,7 +298,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -345,22 +342,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ExternalPrincipal given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExternalPrincipal - * @throws IOException if the JSON string is invalid with respect to ExternalPrincipal - */ + /** + * Create an instance of ExternalPrincipal given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExternalPrincipal + * @throws IOException if the JSON string is invalid with respect to ExternalPrincipal + */ public static ExternalPrincipal fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ExternalPrincipal.class); } - /** - * Convert an instance of ExternalPrincipal to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ExternalPrincipal to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalCreation.java index b1dd043b8f4..4a1a7d87054 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalCreation.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,17 +51,16 @@ /** * ExternalPrincipalCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ExternalPrincipalCreation { public static final String SERIALIZED_NAME_SETTINGS = "settings"; @SerializedName(SERIALIZED_NAME_SETTINGS) - private List> settings; + private List> settings = new ArrayList<>(); public ExternalPrincipalCreation() { } public ExternalPrincipalCreation settings(List> settings) { - this.settings = settings; return this; } @@ -76,16 +73,15 @@ public ExternalPrincipalCreation addSettingsItem(Map settingsIte return this; } - /** + /** * Get settings * @return settings - **/ + */ @javax.annotation.Nullable public List> getSettings() { return settings; } - public void setSettings(List> settings) { this.settings = settings; } @@ -188,12 +184,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExternalPrincipalCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExternalPrincipalCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ExternalPrincipalCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -235,7 +231,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -274,22 +275,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ExternalPrincipalCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExternalPrincipalCreation - * @throws IOException if the JSON string is invalid with respect to ExternalPrincipalCreation - */ + /** + * Create an instance of ExternalPrincipalCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExternalPrincipalCreation + * @throws IOException if the JSON string is invalid with respect to ExternalPrincipalCreation + */ public static ExternalPrincipalCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ExternalPrincipalCreation.class); } - /** - * Convert an instance of ExternalPrincipalCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ExternalPrincipalCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalList.java index 83eacb7a4d7..71604291730 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ExternalPrincipalList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * ExternalPrincipalList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ExternalPrincipalList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public ExternalPrincipalList() { } public ExternalPrincipalList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public ExternalPrincipalList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public ExternalPrincipalList addResultsItem(ExternalPrincipal resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ExternalPrincipalList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ExternalPrincipalList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ExternalPrincipalList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ExternalPrincipalList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ExternalPrincipalList - * @throws IOException if the JSON string is invalid with respect to ExternalPrincipalList - */ + /** + * Create an instance of ExternalPrincipalList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExternalPrincipalList + * @throws IOException if the JSON string is invalid with respect to ExternalPrincipalList + */ public static ExternalPrincipalList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ExternalPrincipalList.class); } - /** - * Convert an instance of ExternalPrincipalList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ExternalPrincipalList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java index 342fa3ad141..bd9bf2fe05b 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/FindMergeBaseResult.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * FindMergeBaseResult */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class FindMergeBaseResult { public static final String SERIALIZED_NAME_SOURCE_COMMIT_ID = "source_commit_id"; @SerializedName(SERIALIZED_NAME_SOURCE_COMMIT_ID) @@ -68,63 +66,57 @@ public FindMergeBaseResult() { } public FindMergeBaseResult sourceCommitId(String sourceCommitId) { - this.sourceCommitId = sourceCommitId; return this; } - /** + /** * The commit ID of the merge source * @return sourceCommitId - **/ + */ @javax.annotation.Nonnull public String getSourceCommitId() { return sourceCommitId; } - public void setSourceCommitId(String sourceCommitId) { this.sourceCommitId = sourceCommitId; } public FindMergeBaseResult destinationCommitId(String destinationCommitId) { - this.destinationCommitId = destinationCommitId; return this; } - /** + /** * The commit ID of the merge destination * @return destinationCommitId - **/ + */ @javax.annotation.Nonnull public String getDestinationCommitId() { return destinationCommitId; } - public void setDestinationCommitId(String destinationCommitId) { this.destinationCommitId = destinationCommitId; } public FindMergeBaseResult baseCommitId(String baseCommitId) { - this.baseCommitId = baseCommitId; return this; } - /** + /** * The commit ID of the merge base * @return baseCommitId - **/ + */ @javax.annotation.Nonnull public String getBaseCommitId() { return baseCommitId; } - public void setBaseCommitId(String baseCommitId) { this.baseCommitId = baseCommitId; } @@ -236,12 +228,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("base_commit_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to FindMergeBaseResult - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FindMergeBaseResult + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!FindMergeBaseResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -295,7 +287,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -334,22 +331,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of FindMergeBaseResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of FindMergeBaseResult - * @throws IOException if the JSON string is invalid with respect to FindMergeBaseResult - */ + /** + * Create an instance of FindMergeBaseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of FindMergeBaseResult + * @throws IOException if the JSON string is invalid with respect to FindMergeBaseResult + */ public static FindMergeBaseResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, FindMergeBaseResult.class); } - /** - * Convert an instance of FindMergeBaseResult to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of FindMergeBaseResult to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java index e1291bc8750..833442efbcb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionConfig.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * GarbageCollectionConfig */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class GarbageCollectionConfig { public static final String SERIALIZED_NAME_GRACE_PERIOD = "grace_period"; @SerializedName(SERIALIZED_NAME_GRACE_PERIOD) @@ -60,21 +58,19 @@ public GarbageCollectionConfig() { } public GarbageCollectionConfig gracePeriod(Integer gracePeriod) { - this.gracePeriod = gracePeriod; return this; } - /** + /** * Duration in seconds. Objects created in the recent grace_period will not be collected. * @return gracePeriod - **/ + */ @javax.annotation.Nullable public Integer getGracePeriod() { return gracePeriod; } - public void setGracePeriod(Integer gracePeriod) { this.gracePeriod = gracePeriod; } @@ -177,12 +173,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionConfig - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionConfig + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GarbageCollectionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -220,7 +216,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -259,22 +260,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of GarbageCollectionConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of GarbageCollectionConfig - * @throws IOException if the JSON string is invalid with respect to GarbageCollectionConfig - */ + /** + * Create an instance of GarbageCollectionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionConfig + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionConfig + */ public static GarbageCollectionConfig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GarbageCollectionConfig.class); } - /** - * Convert an instance of GarbageCollectionConfig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GarbageCollectionConfig to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java index 2978a5ff101..0312ddada9c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionPrepareResponse.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * GarbageCollectionPrepareResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class GarbageCollectionPrepareResponse { public static final String SERIALIZED_NAME_RUN_ID = "run_id"; @SerializedName(SERIALIZED_NAME_RUN_ID) @@ -72,84 +70,76 @@ public GarbageCollectionPrepareResponse() { } public GarbageCollectionPrepareResponse runId(String runId) { - this.runId = runId; return this; } - /** + /** * a unique identifier generated for this GC job * @return runId - **/ + */ @javax.annotation.Nonnull public String getRunId() { return runId; } - public void setRunId(String runId) { this.runId = runId; } public GarbageCollectionPrepareResponse gcCommitsLocation(String gcCommitsLocation) { - this.gcCommitsLocation = gcCommitsLocation; return this; } - /** + /** * location of the resulting commits csv table (partitioned by run_id) * @return gcCommitsLocation - **/ + */ @javax.annotation.Nonnull public String getGcCommitsLocation() { return gcCommitsLocation; } - public void setGcCommitsLocation(String gcCommitsLocation) { this.gcCommitsLocation = gcCommitsLocation; } public GarbageCollectionPrepareResponse gcAddressesLocation(String gcAddressesLocation) { - this.gcAddressesLocation = gcAddressesLocation; return this; } - /** + /** * location to use for expired addresses parquet table (partitioned by run_id) * @return gcAddressesLocation - **/ + */ @javax.annotation.Nonnull public String getGcAddressesLocation() { return gcAddressesLocation; } - public void setGcAddressesLocation(String gcAddressesLocation) { this.gcAddressesLocation = gcAddressesLocation; } public GarbageCollectionPrepareResponse gcCommitsPresignedUrl(String gcCommitsPresignedUrl) { - this.gcCommitsPresignedUrl = gcCommitsPresignedUrl; return this; } - /** + /** * a presigned url to download the commits csv * @return gcCommitsPresignedUrl - **/ + */ @javax.annotation.Nullable public String getGcCommitsPresignedUrl() { return gcCommitsPresignedUrl; } - public void setGcCommitsPresignedUrl(String gcCommitsPresignedUrl) { this.gcCommitsPresignedUrl = gcCommitsPresignedUrl; } @@ -264,12 +254,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("gc_addresses_location"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionPrepareResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionPrepareResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GarbageCollectionPrepareResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -326,7 +316,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -365,22 +360,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of GarbageCollectionPrepareResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of GarbageCollectionPrepareResponse - * @throws IOException if the JSON string is invalid with respect to GarbageCollectionPrepareResponse - */ + /** + * Create an instance of GarbageCollectionPrepareResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionPrepareResponse + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionPrepareResponse + */ public static GarbageCollectionPrepareResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GarbageCollectionPrepareResponse.class); } - /** - * Convert an instance of GarbageCollectionPrepareResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GarbageCollectionPrepareResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java index fd9f3d8b581..4af097970cf 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRule.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * GarbageCollectionRule */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class GarbageCollectionRule { public static final String SERIALIZED_NAME_BRANCH_ID = "branch_id"; @SerializedName(SERIALIZED_NAME_BRANCH_ID) @@ -64,42 +62,38 @@ public GarbageCollectionRule() { } public GarbageCollectionRule branchId(String branchId) { - this.branchId = branchId; return this; } - /** + /** * Get branchId * @return branchId - **/ + */ @javax.annotation.Nonnull public String getBranchId() { return branchId; } - public void setBranchId(String branchId) { this.branchId = branchId; } public GarbageCollectionRule retentionDays(Integer retentionDays) { - this.retentionDays = retentionDays; return this; } - /** + /** * Get retentionDays * @return retentionDays - **/ + */ @javax.annotation.Nonnull public Integer getRetentionDays() { return retentionDays; } - public void setRetentionDays(Integer retentionDays) { this.retentionDays = retentionDays; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("retention_days"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionRule - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionRule + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GarbageCollectionRule.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -260,7 +254,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -299,22 +298,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of GarbageCollectionRule given an JSON string - * - * @param jsonString JSON string - * @return An instance of GarbageCollectionRule - * @throws IOException if the JSON string is invalid with respect to GarbageCollectionRule - */ + /** + * Create an instance of GarbageCollectionRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionRule + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionRule + */ public static GarbageCollectionRule fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GarbageCollectionRule.class); } - /** - * Convert an instance of GarbageCollectionRule to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GarbageCollectionRule to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java index d936e5855db..56d081ec7bb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GarbageCollectionRules.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * GarbageCollectionRules */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class GarbageCollectionRules { public static final String SERIALIZED_NAME_DEFAULT_RETENTION_DAYS = "default_retention_days"; @SerializedName(SERIALIZED_NAME_DEFAULT_RETENTION_DAYS) @@ -67,28 +65,25 @@ public GarbageCollectionRules() { } public GarbageCollectionRules defaultRetentionDays(Integer defaultRetentionDays) { - this.defaultRetentionDays = defaultRetentionDays; return this; } - /** + /** * Get defaultRetentionDays * @return defaultRetentionDays - **/ + */ @javax.annotation.Nonnull public Integer getDefaultRetentionDays() { return defaultRetentionDays; } - public void setDefaultRetentionDays(Integer defaultRetentionDays) { this.defaultRetentionDays = defaultRetentionDays; } public GarbageCollectionRules branches(List branches) { - this.branches = branches; return this; } @@ -101,16 +96,15 @@ public GarbageCollectionRules addBranchesItem(GarbageCollectionRule branchesItem return this; } - /** + /** * Get branches * @return branches - **/ + */ @javax.annotation.Nonnull public List getBranches() { return branches; } - public void setBranches(List branches) { this.branches = branches; } @@ -218,12 +212,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("branches"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionRules - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GarbageCollectionRules + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GarbageCollectionRules.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -278,7 +272,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -317,22 +316,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of GarbageCollectionRules given an JSON string - * - * @param jsonString JSON string - * @return An instance of GarbageCollectionRules - * @throws IOException if the JSON string is invalid with respect to GarbageCollectionRules - */ + /** + * Create an instance of GarbageCollectionRules given an JSON string + * + * @param jsonString JSON string + * @return An instance of GarbageCollectionRules + * @throws IOException if the JSON string is invalid with respect to GarbageCollectionRules + */ public static GarbageCollectionRules fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GarbageCollectionRules.class); } - /** - * Convert an instance of GarbageCollectionRules to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GarbageCollectionRules to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java index b812423151b..fed81a1e216 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Group.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Group */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Group { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -68,63 +66,57 @@ public Group() { } public Group id(String id) { - this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public Group name(String name) { - this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; } - public void setName(String name) { this.name = name; } public Group creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } @@ -235,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("creation_date"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Group - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Group + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Group.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -291,7 +283,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -330,22 +327,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Group given an JSON string - * - * @param jsonString JSON string - * @return An instance of Group - * @throws IOException if the JSON string is invalid with respect to Group - */ + /** + * Create an instance of Group given an JSON string + * + * @param jsonString JSON string + * @return An instance of Group + * @throws IOException if the JSON string is invalid with respect to Group + */ public static Group fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Group.class); } - /** - * Convert an instance of Group to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Group to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java index a8b0be2a832..6ac19c050b1 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * GroupCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class GroupCreation { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,21 +58,19 @@ public GroupCreation() { } public GroupCreation id(String id) { - this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GroupCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GroupCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of GroupCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupCreation - * @throws IOException if the JSON string is invalid with respect to GroupCreation - */ + /** + * Create an instance of GroupCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupCreation + * @throws IOException if the JSON string is invalid with respect to GroupCreation + */ public static GroupCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupCreation.class); } - /** - * Convert an instance of GroupCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java index 8cdb8eeb2e3..dadbc3b3edb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/GroupList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * GroupList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class GroupList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public GroupList() { } public GroupList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public GroupList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public GroupList addResultsItem(Group resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to GroupList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to GroupList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!GroupList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of GroupList given an JSON string - * - * @param jsonString JSON string - * @return An instance of GroupList - * @throws IOException if the JSON string is invalid with respect to GroupList - */ + /** + * Create an instance of GroupList given an JSON string + * + * @param jsonString JSON string + * @return An instance of GroupList + * @throws IOException if the JSON string is invalid with respect to GroupList + */ public static GroupList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GroupList.class); } - /** - * Convert an instance of GroupList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of GroupList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java index eca8e126434..8d8f715e7e2 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRun.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * HookRun */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HookRun { public static final String SERIALIZED_NAME_HOOK_RUN_ID = "hook_run_id"; @SerializedName(SERIALIZED_NAME_HOOK_RUN_ID) @@ -118,6 +116,11 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { return StatusEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_STATUS = "status"; @@ -128,126 +131,114 @@ public HookRun() { } public HookRun hookRunId(String hookRunId) { - this.hookRunId = hookRunId; return this; } - /** + /** * Get hookRunId * @return hookRunId - **/ + */ @javax.annotation.Nonnull public String getHookRunId() { return hookRunId; } - public void setHookRunId(String hookRunId) { this.hookRunId = hookRunId; } public HookRun action(String action) { - this.action = action; return this; } - /** + /** * Get action * @return action - **/ + */ @javax.annotation.Nonnull public String getAction() { return action; } - public void setAction(String action) { this.action = action; } public HookRun hookId(String hookId) { - this.hookId = hookId; return this; } - /** + /** * Get hookId * @return hookId - **/ + */ @javax.annotation.Nonnull public String getHookId() { return hookId; } - public void setHookId(String hookId) { this.hookId = hookId; } public HookRun startTime(OffsetDateTime startTime) { - this.startTime = startTime; return this; } - /** + /** * Get startTime * @return startTime - **/ + */ @javax.annotation.Nonnull public OffsetDateTime getStartTime() { return startTime; } - public void setStartTime(OffsetDateTime startTime) { this.startTime = startTime; } public HookRun endTime(OffsetDateTime endTime) { - this.endTime = endTime; return this; } - /** + /** * Get endTime * @return endTime - **/ + */ @javax.annotation.Nullable public OffsetDateTime getEndTime() { return endTime; } - public void setEndTime(OffsetDateTime endTime) { this.endTime = endTime; } public HookRun status(StatusEnum status) { - this.status = status; return this; } - /** + /** * Get status * @return status - **/ + */ @javax.annotation.Nonnull public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } @@ -370,12 +361,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("status"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to HookRun - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HookRun + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!HookRun.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -402,6 +393,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -432,7 +425,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -471,22 +469,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of HookRun given an JSON string - * - * @param jsonString JSON string - * @return An instance of HookRun - * @throws IOException if the JSON string is invalid with respect to HookRun - */ + /** + * Create an instance of HookRun given an JSON string + * + * @param jsonString JSON string + * @return An instance of HookRun + * @throws IOException if the JSON string is invalid with respect to HookRun + */ public static HookRun fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HookRun.class); } - /** - * Convert an instance of HookRun to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HookRun to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java index c91c62157b8..8ac0e4f13eb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/HookRunList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * HookRunList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class HookRunList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public HookRunList() { } public HookRunList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public HookRunList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public HookRunList addResultsItem(HookRun resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to HookRunList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to HookRunList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!HookRunList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of HookRunList given an JSON string - * - * @param jsonString JSON string - * @return An instance of HookRunList - * @throws IOException if the JSON string is invalid with respect to HookRunList - */ + /** + * Create an instance of HookRunList given an JSON string + * + * @param jsonString JSON string + * @return An instance of HookRunList + * @throws IOException if the JSON string is invalid with respect to HookRunList + */ public static HookRunList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, HookRunList.class); } - /** - * Convert an instance of HookRunList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of HookRunList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java index 695bf107e33..a40abb047c8 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreation.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * ImportCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ImportCreation { public static final String SERIALIZED_NAME_PATHS = "paths"; @SerializedName(SERIALIZED_NAME_PATHS) @@ -72,7 +70,6 @@ public ImportCreation() { } public ImportCreation paths(List paths) { - this.paths = paths; return this; } @@ -85,58 +82,53 @@ public ImportCreation addPathsItem(ImportLocation pathsItem) { return this; } - /** + /** * Get paths * @return paths - **/ + */ @javax.annotation.Nonnull public List getPaths() { return paths; } - public void setPaths(List paths) { this.paths = paths; } public ImportCreation commit(CommitCreation commit) { - this.commit = commit; return this; } - /** + /** * Get commit * @return commit - **/ + */ @javax.annotation.Nonnull public CommitCreation getCommit() { return commit; } - public void setCommit(CommitCreation commit) { this.commit = commit; } public ImportCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -247,12 +239,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("commit"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ImportCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ImportCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -309,7 +301,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -348,22 +345,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ImportCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ImportCreation - * @throws IOException if the JSON string is invalid with respect to ImportCreation - */ + /** + * Create an instance of ImportCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportCreation + * @throws IOException if the JSON string is invalid with respect to ImportCreation + */ public static ImportCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ImportCreation.class); } - /** - * Convert an instance of ImportCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ImportCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java index 0205e0190a7..eb8bdde9af6 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportCreationResponse.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ImportCreationResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ImportCreationResponse { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,21 +58,19 @@ public ImportCreationResponse() { } public ImportCreationResponse id(String id) { - this.id = id; return this; } - /** + /** * The id of the import process * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ImportCreationResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportCreationResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ImportCreationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ImportCreationResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of ImportCreationResponse - * @throws IOException if the JSON string is invalid with respect to ImportCreationResponse - */ + /** + * Create an instance of ImportCreationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportCreationResponse + * @throws IOException if the JSON string is invalid with respect to ImportCreationResponse + */ public static ImportCreationResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ImportCreationResponse.class); } - /** - * Convert an instance of ImportCreationResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ImportCreationResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java index 116e6a85cab..100d0e944ca 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportLocation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ImportLocation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ImportLocation { /** * Path type, can either be 'common_prefix' or 'object' @@ -97,6 +95,11 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { return TypeEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_TYPE = "type"; @@ -115,63 +118,57 @@ public ImportLocation() { } public ImportLocation type(TypeEnum type) { - this.type = type; return this; } - /** + /** * Path type, can either be 'common_prefix' or 'object' * @return type - **/ + */ @javax.annotation.Nonnull public TypeEnum getType() { return type; } - public void setType(TypeEnum type) { this.type = type; } public ImportLocation path(String path) { - this.path = path; return this; } - /** + /** * A source location to a 'common_prefix' or to a single object. Must match the lakeFS installation blockstore type. * @return path - **/ + */ @javax.annotation.Nonnull public String getPath() { return path; } - public void setPath(String path) { this.path = path; } public ImportLocation destination(String destination) { - this.destination = destination; return this; } - /** + /** * Destination for the imported objects on the branch. Must be a relative path to the branch. If the type is an 'object', the destination is the exact object name under the branch. If the type is a 'common_prefix', the destination is the prefix under the branch. * @return destination - **/ + */ @javax.annotation.Nonnull public String getDestination() { return destination; } - public void setDestination(String destination) { this.destination = destination; } @@ -283,12 +280,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("destination"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ImportLocation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportLocation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ImportLocation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -306,6 +303,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if (!jsonObj.get("path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); } @@ -342,7 +341,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -381,22 +385,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ImportLocation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ImportLocation - * @throws IOException if the JSON string is invalid with respect to ImportLocation - */ + /** + * Create an instance of ImportLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportLocation + * @throws IOException if the JSON string is invalid with respect to ImportLocation + */ public static ImportLocation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ImportLocation.class); } - /** - * Convert an instance of ImportLocation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ImportLocation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java index c6885ec3ee2..9541dcb41e3 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ImportStatus.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * ImportStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ImportStatus { public static final String SERIALIZED_NAME_COMPLETED = "completed"; @SerializedName(SERIALIZED_NAME_COMPLETED) @@ -83,126 +81,114 @@ public ImportStatus() { } public ImportStatus completed(Boolean completed) { - this.completed = completed; return this; } - /** + /** * Get completed * @return completed - **/ + */ @javax.annotation.Nonnull public Boolean getCompleted() { return completed; } - public void setCompleted(Boolean completed) { this.completed = completed; } public ImportStatus updateTime(OffsetDateTime updateTime) { - this.updateTime = updateTime; return this; } - /** + /** * Get updateTime * @return updateTime - **/ + */ @javax.annotation.Nonnull public OffsetDateTime getUpdateTime() { return updateTime; } - public void setUpdateTime(OffsetDateTime updateTime) { this.updateTime = updateTime; } public ImportStatus ingestedObjects(Long ingestedObjects) { - this.ingestedObjects = ingestedObjects; return this; } - /** + /** * Number of objects processed so far * @return ingestedObjects - **/ + */ @javax.annotation.Nullable public Long getIngestedObjects() { return ingestedObjects; } - public void setIngestedObjects(Long ingestedObjects) { this.ingestedObjects = ingestedObjects; } public ImportStatus metarangeId(String metarangeId) { - this.metarangeId = metarangeId; return this; } - /** + /** * Get metarangeId * @return metarangeId - **/ + */ @javax.annotation.Nullable public String getMetarangeId() { return metarangeId; } - public void setMetarangeId(String metarangeId) { this.metarangeId = metarangeId; } public ImportStatus commit(Commit commit) { - this.commit = commit; return this; } - /** + /** * Get commit * @return commit - **/ + */ @javax.annotation.Nullable public Commit getCommit() { return commit; } - public void setCommit(Commit commit) { this.commit = commit; } public ImportStatus error(Error error) { - this.error = error; return this; } - /** + /** * Get error * @return error - **/ + */ @javax.annotation.Nullable public Error getError() { return error; } - public void setError(Error error) { this.error = error; } @@ -322,12 +308,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("update_time"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ImportStatus - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ImportStatus + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ImportStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -383,7 +369,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -422,22 +413,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ImportStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of ImportStatus - * @throws IOException if the JSON string is invalid with respect to ImportStatus - */ + /** + * Create an instance of ImportStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of ImportStatus + * @throws IOException if the JSON string is invalid with respect to ImportStatus + */ public static ImportStatus fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ImportStatus.class); } - /** - * Convert an instance of ImportStatus to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ImportStatus to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/InstallationUsageReport.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/InstallationUsageReport.java index d397cd10ad3..4185c8b84a2 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/InstallationUsageReport.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/InstallationUsageReport.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * InstallationUsageReport */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class InstallationUsageReport { public static final String SERIALIZED_NAME_INSTALLATION_ID = "installation_id"; @SerializedName(SERIALIZED_NAME_INSTALLATION_ID) @@ -67,28 +65,25 @@ public InstallationUsageReport() { } public InstallationUsageReport installationId(String installationId) { - this.installationId = installationId; return this; } - /** + /** * Get installationId * @return installationId - **/ + */ @javax.annotation.Nonnull public String getInstallationId() { return installationId; } - public void setInstallationId(String installationId) { this.installationId = installationId; } public InstallationUsageReport reports(List reports) { - this.reports = reports; return this; } @@ -101,16 +96,15 @@ public InstallationUsageReport addReportsItem(UsageReport reportsItem) { return this; } - /** + /** * Get reports * @return reports - **/ + */ @javax.annotation.Nonnull public List getReports() { return reports; } - public void setReports(List reports) { this.reports = reports; } @@ -218,12 +212,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reports"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InstallationUsageReport - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InstallationUsageReport + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!InstallationUsageReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of InstallationUsageReport given an JSON string - * - * @param jsonString JSON string - * @return An instance of InstallationUsageReport - * @throws IOException if the JSON string is invalid with respect to InstallationUsageReport - */ + /** + * Create an instance of InstallationUsageReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of InstallationUsageReport + * @throws IOException if the JSON string is invalid with respect to InstallationUsageReport + */ public static InstallationUsageReport fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InstallationUsageReport.class); } - /** - * Convert an instance of InstallationUsageReport to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InstallationUsageReport to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/InternalDeleteBranchProtectionRuleRequest.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/InternalDeleteBranchProtectionRuleRequest.java index 78337f1b13d..175be9213e7 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/InternalDeleteBranchProtectionRuleRequest.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/InternalDeleteBranchProtectionRuleRequest.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * InternalDeleteBranchProtectionRuleRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class InternalDeleteBranchProtectionRuleRequest { public static final String SERIALIZED_NAME_PATTERN = "pattern"; @SerializedName(SERIALIZED_NAME_PATTERN) @@ -60,21 +58,19 @@ public InternalDeleteBranchProtectionRuleRequest() { } public InternalDeleteBranchProtectionRuleRequest pattern(String pattern) { - this.pattern = pattern; return this; } - /** + /** * Get pattern * @return pattern - **/ + */ @javax.annotation.Nonnull public String getPattern() { return pattern; } - public void setPattern(String pattern) { this.pattern = pattern; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pattern"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InternalDeleteBranchProtectionRuleRequest - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InternalDeleteBranchProtectionRuleRequest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!InternalDeleteBranchProtectionRuleRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of InternalDeleteBranchProtectionRuleRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of InternalDeleteBranchProtectionRuleRequest - * @throws IOException if the JSON string is invalid with respect to InternalDeleteBranchProtectionRuleRequest - */ + /** + * Create an instance of InternalDeleteBranchProtectionRuleRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of InternalDeleteBranchProtectionRuleRequest + * @throws IOException if the JSON string is invalid with respect to InternalDeleteBranchProtectionRuleRequest + */ public static InternalDeleteBranchProtectionRuleRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InternalDeleteBranchProtectionRuleRequest.class); } - /** - * Convert an instance of InternalDeleteBranchProtectionRuleRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InternalDeleteBranchProtectionRuleRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java index 961fae7dbb9..a6aa5b9d241 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginConfig.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * LoginConfig */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class LoginConfig { /** * RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. @@ -99,6 +97,11 @@ public RBACEnum read(final JsonReader jsonReader) throws IOException { return RBACEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RBACEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_R_B_A_C = "RBAC"; @@ -133,112 +136,101 @@ public LoginConfig() { } public LoginConfig RBAC(RBACEnum RBAC) { - this.RBAC = RBAC; return this; } - /** + /** * RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. * @return RBAC - **/ + */ @javax.annotation.Nullable public RBACEnum getRBAC() { return RBAC; } - public void setRBAC(RBACEnum RBAC) { this.RBAC = RBAC; } public LoginConfig loginUrl(String loginUrl) { - this.loginUrl = loginUrl; return this; } - /** + /** * primary URL to use for login. * @return loginUrl - **/ + */ @javax.annotation.Nonnull public String getLoginUrl() { return loginUrl; } - public void setLoginUrl(String loginUrl) { this.loginUrl = loginUrl; } public LoginConfig loginFailedMessage(String loginFailedMessage) { - this.loginFailedMessage = loginFailedMessage; return this; } - /** + /** * message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method * @return loginFailedMessage - **/ + */ @javax.annotation.Nullable public String getLoginFailedMessage() { return loginFailedMessage; } - public void setLoginFailedMessage(String loginFailedMessage) { this.loginFailedMessage = loginFailedMessage; } public LoginConfig fallbackLoginUrl(String fallbackLoginUrl) { - this.fallbackLoginUrl = fallbackLoginUrl; return this; } - /** + /** * secondary URL to offer users to use for login. * @return fallbackLoginUrl - **/ + */ @javax.annotation.Nullable public String getFallbackLoginUrl() { return fallbackLoginUrl; } - public void setFallbackLoginUrl(String fallbackLoginUrl) { this.fallbackLoginUrl = fallbackLoginUrl; } public LoginConfig fallbackLoginLabel(String fallbackLoginLabel) { - this.fallbackLoginLabel = fallbackLoginLabel; return this; } - /** + /** * label to place on fallback_login_url. * @return fallbackLoginLabel - **/ + */ @javax.annotation.Nullable public String getFallbackLoginLabel() { return fallbackLoginLabel; } - public void setFallbackLoginLabel(String fallbackLoginLabel) { this.fallbackLoginLabel = fallbackLoginLabel; } public LoginConfig loginCookieNames(List loginCookieNames) { - this.loginCookieNames = loginCookieNames; return this; } @@ -251,37 +243,34 @@ public LoginConfig addLoginCookieNamesItem(String loginCookieNamesItem) { return this; } - /** + /** * cookie names used to store JWT * @return loginCookieNames - **/ + */ @javax.annotation.Nonnull public List getLoginCookieNames() { return loginCookieNames; } - public void setLoginCookieNames(List loginCookieNames) { this.loginCookieNames = loginCookieNames; } public LoginConfig logoutUrl(String logoutUrl) { - this.logoutUrl = logoutUrl; return this; } - /** + /** * URL to use for logging out. * @return logoutUrl - **/ + */ @javax.annotation.Nonnull public String getLogoutUrl() { return logoutUrl; } - public void setLogoutUrl(String logoutUrl) { this.logoutUrl = logoutUrl; } @@ -405,12 +394,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("logout_url"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LoginConfig - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LoginConfig + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!LoginConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -428,6 +417,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("RBAC") != null && !jsonObj.get("RBAC").isJsonNull()) && !jsonObj.get("RBAC").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `RBAC` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RBAC").toString())); } + // validate the optional field `RBAC` + if (jsonObj.get("RBAC") != null && !jsonObj.get("RBAC").isJsonNull()) { + RBACEnum.validateJsonElement(jsonObj.get("RBAC")); + } if (!jsonObj.get("login_url").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `login_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("login_url").toString())); } @@ -479,7 +472,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -518,22 +516,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of LoginConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of LoginConfig - * @throws IOException if the JSON string is invalid with respect to LoginConfig - */ + /** + * Create an instance of LoginConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginConfig + * @throws IOException if the JSON string is invalid with respect to LoginConfig + */ public static LoginConfig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LoginConfig.class); } - /** - * Convert an instance of LoginConfig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LoginConfig to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java index 04635ad41f1..80918105ea1 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/LoginInformation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * LoginInformation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class LoginInformation { public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "access_key_id"; @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) @@ -64,42 +62,38 @@ public LoginInformation() { } public LoginInformation accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; return this; } - /** + /** * Get accessKeyId * @return accessKeyId - **/ + */ @javax.annotation.Nonnull public String getAccessKeyId() { return accessKeyId; } - public void setAccessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; } public LoginInformation secretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; return this; } - /** + /** * Get secretAccessKey * @return secretAccessKey - **/ + */ @javax.annotation.Nonnull public String getSecretAccessKey() { return secretAccessKey; } - public void setSecretAccessKey(String secretAccessKey) { this.secretAccessKey = secretAccessKey; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("secret_access_key"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to LoginInformation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to LoginInformation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!LoginInformation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -263,7 +257,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -302,22 +301,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of LoginInformation given an JSON string - * - * @param jsonString JSON string - * @return An instance of LoginInformation - * @throws IOException if the JSON string is invalid with respect to LoginInformation - */ + /** + * Create an instance of LoginInformation given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginInformation + * @throws IOException if the JSON string is invalid with respect to LoginInformation + */ public static LoginInformation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, LoginInformation.class); } - /** - * Convert an instance of LoginInformation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of LoginInformation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java index 2c380740f60..2f24ef66821 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Merge.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * Merge */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Merge { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -78,28 +76,25 @@ public Merge() { } public Merge message(String message) { - this.message = message; return this; } - /** + /** * Get message * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public Merge metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -112,79 +107,72 @@ public Merge putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } public Merge strategy(String strategy) { - this.strategy = strategy; return this; } - /** + /** * In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict * @return strategy - **/ + */ @javax.annotation.Nullable public String getStrategy() { return strategy; } - public void setStrategy(String strategy) { this.strategy = strategy; } public Merge force(Boolean force) { - this.force = force; return this; } - /** + /** * Allow merge into a read-only branch or into a branch with the same content * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } public Merge allowEmpty(Boolean allowEmpty) { - this.allowEmpty = allowEmpty; return this; } - /** + /** * Allow merge when the branches have the same content * @return allowEmpty - **/ + */ @javax.annotation.Nullable public Boolean getAllowEmpty() { return allowEmpty; } - public void setAllowEmpty(Boolean allowEmpty) { this.allowEmpty = allowEmpty; } @@ -299,12 +287,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Merge - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Merge + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Merge.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -348,7 +336,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -387,22 +380,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Merge given an JSON string - * - * @param jsonString JSON string - * @return An instance of Merge - * @throws IOException if the JSON string is invalid with respect to Merge - */ + /** + * Create an instance of Merge given an JSON string + * + * @param jsonString JSON string + * @return An instance of Merge + * @throws IOException if the JSON string is invalid with respect to Merge + */ public static Merge fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Merge.class); } - /** - * Convert an instance of Merge to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Merge to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java index 435f0b087c1..3839bf99f7c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MergeResult.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * MergeResult */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class MergeResult { public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) @@ -60,21 +58,19 @@ public MergeResult() { } public MergeResult reference(String reference) { - this.reference = reference; return this; } - /** + /** * Get reference * @return reference - **/ + */ @javax.annotation.Nonnull public String getReference() { return reference; } - public void setReference(String reference) { this.reference = reference; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MergeResult - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MergeResult + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MergeResult.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of MergeResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of MergeResult - * @throws IOException if the JSON string is invalid with respect to MergeResult - */ + /** + * Create an instance of MergeResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of MergeResult + * @throws IOException if the JSON string is invalid with respect to MergeResult + */ public static MergeResult fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MergeResult.class); } - /** - * Convert an instance of MergeResult to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MergeResult to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java index 07c6f20b39c..6e882cb11e2 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreation.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * MetaRangeCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class MetaRangeCreation { public static final String SERIALIZED_NAME_RANGES = "ranges"; @SerializedName(SERIALIZED_NAME_RANGES) @@ -63,7 +61,6 @@ public MetaRangeCreation() { } public MetaRangeCreation ranges(List ranges) { - this.ranges = ranges; return this; } @@ -76,16 +73,15 @@ public MetaRangeCreation addRangesItem(RangeMetadata rangesItem) { return this; } - /** + /** * Get ranges * @return ranges - **/ + */ @javax.annotation.Nonnull public List getRanges() { return ranges; } - public void setRanges(List ranges) { this.ranges = ranges; } @@ -189,12 +185,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ranges"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MetaRangeCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MetaRangeCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MetaRangeCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -249,7 +245,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -288,22 +289,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of MetaRangeCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of MetaRangeCreation - * @throws IOException if the JSON string is invalid with respect to MetaRangeCreation - */ + /** + * Create an instance of MetaRangeCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetaRangeCreation + * @throws IOException if the JSON string is invalid with respect to MetaRangeCreation + */ public static MetaRangeCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MetaRangeCreation.class); } - /** - * Convert an instance of MetaRangeCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MetaRangeCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java index 27e3ec2c4ed..dc35092442c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/MetaRangeCreationResponse.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * MetaRangeCreationResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class MetaRangeCreationResponse { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,21 +58,19 @@ public MetaRangeCreationResponse() { } public MetaRangeCreationResponse id(String id) { - this.id = id; return this; } - /** + /** * The id of the created metarange * @return id - **/ + */ @javax.annotation.Nullable public String getId() { return id; } - public void setId(String id) { this.id = id; } @@ -177,12 +173,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MetaRangeCreationResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MetaRangeCreationResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MetaRangeCreationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -223,7 +219,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -262,22 +263,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of MetaRangeCreationResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of MetaRangeCreationResponse - * @throws IOException if the JSON string is invalid with respect to MetaRangeCreationResponse - */ + /** + * Create an instance of MetaRangeCreationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MetaRangeCreationResponse + * @throws IOException if the JSON string is invalid with respect to MetaRangeCreationResponse + */ public static MetaRangeCreationResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MetaRangeCreationResponse.class); } - /** - * Convert an instance of MetaRangeCreationResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MetaRangeCreationResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java index 3ccc7146fe7..34f23381532 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectCopyCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ObjectCopyCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ObjectCopyCreation { public static final String SERIALIZED_NAME_SRC_PATH = "src_path"; @SerializedName(SERIALIZED_NAME_SRC_PATH) @@ -68,63 +66,57 @@ public ObjectCopyCreation() { } public ObjectCopyCreation srcPath(String srcPath) { - this.srcPath = srcPath; return this; } - /** + /** * path of the copied object relative to the ref * @return srcPath - **/ + */ @javax.annotation.Nonnull public String getSrcPath() { return srcPath; } - public void setSrcPath(String srcPath) { this.srcPath = srcPath; } public ObjectCopyCreation srcRef(String srcRef) { - this.srcRef = srcRef; return this; } - /** + /** * a reference, if empty uses the provided branch as ref * @return srcRef - **/ + */ @javax.annotation.Nullable public String getSrcRef() { return srcRef; } - public void setSrcRef(String srcRef) { this.srcRef = srcRef; } public ObjectCopyCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -234,12 +226,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("src_path"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ObjectCopyCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectCopyCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectCopyCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -290,7 +282,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -329,22 +326,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ObjectCopyCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectCopyCreation - * @throws IOException if the JSON string is invalid with respect to ObjectCopyCreation - */ + /** + * Create an instance of ObjectCopyCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectCopyCreation + * @throws IOException if the JSON string is invalid with respect to ObjectCopyCreation + */ public static ObjectCopyCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectCopyCreation.class); } - /** - * Convert an instance of ObjectCopyCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectCopyCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java index 6e0351e8d21..71fce26fb44 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectError.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ObjectError */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ObjectError { public static final String SERIALIZED_NAME_STATUS_CODE = "status_code"; @SerializedName(SERIALIZED_NAME_STATUS_CODE) @@ -68,63 +66,57 @@ public ObjectError() { } public ObjectError statusCode(Integer statusCode) { - this.statusCode = statusCode; return this; } - /** + /** * HTTP status code associated for operation on path * @return statusCode - **/ + */ @javax.annotation.Nonnull public Integer getStatusCode() { return statusCode; } - public void setStatusCode(Integer statusCode) { this.statusCode = statusCode; } public ObjectError message(String message) { - this.message = message; return this; } - /** + /** * short message explaining status_code * @return message - **/ + */ @javax.annotation.Nonnull public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } public ObjectError path(String path) { - this.path = path; return this; } - /** + /** * affected path * @return path - **/ + */ @javax.annotation.Nullable public String getPath() { return path; } - public void setPath(String path) { this.path = path; } @@ -235,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("message"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ObjectError - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectError + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -291,7 +283,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -330,22 +327,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ObjectError given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectError - * @throws IOException if the JSON string is invalid with respect to ObjectError - */ + /** + * Create an instance of ObjectError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectError + * @throws IOException if the JSON string is invalid with respect to ObjectError + */ public static ObjectError fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectError.class); } - /** - * Convert an instance of ObjectError to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectError to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java index 66c01c787de..84e5bbc4ebc 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectErrorList.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * ObjectErrorList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ObjectErrorList { public static final String SERIALIZED_NAME_ERRORS = "errors"; @SerializedName(SERIALIZED_NAME_ERRORS) @@ -63,7 +61,6 @@ public ObjectErrorList() { } public ObjectErrorList errors(List errors) { - this.errors = errors; return this; } @@ -76,16 +73,15 @@ public ObjectErrorList addErrorsItem(ObjectError errorsItem) { return this; } - /** + /** * Get errors * @return errors - **/ + */ @javax.annotation.Nonnull public List getErrors() { return errors; } - public void setErrors(List errors) { this.errors = errors; } @@ -189,12 +185,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("errors"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ObjectErrorList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectErrorList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectErrorList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -249,7 +245,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -288,22 +289,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ObjectErrorList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectErrorList - * @throws IOException if the JSON string is invalid with respect to ObjectErrorList - */ + /** + * Create an instance of ObjectErrorList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectErrorList + * @throws IOException if the JSON string is invalid with respect to ObjectErrorList + */ public static ObjectErrorList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectErrorList.class); } - /** - * Convert an instance of ObjectErrorList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectErrorList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java index 06bda0feed2..944a3bebd1b 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStageCreation.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * ObjectStageCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ObjectStageCreation { public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) @@ -86,91 +84,82 @@ public ObjectStageCreation() { } public ObjectStageCreation physicalAddress(String physicalAddress) { - this.physicalAddress = physicalAddress; return this; } - /** + /** * Get physicalAddress * @return physicalAddress - **/ + */ @javax.annotation.Nonnull public String getPhysicalAddress() { return physicalAddress; } - public void setPhysicalAddress(String physicalAddress) { this.physicalAddress = physicalAddress; } public ObjectStageCreation checksum(String checksum) { - this.checksum = checksum; return this; } - /** + /** * Get checksum * @return checksum - **/ + */ @javax.annotation.Nonnull public String getChecksum() { return checksum; } - public void setChecksum(String checksum) { this.checksum = checksum; } public ObjectStageCreation sizeBytes(Long sizeBytes) { - this.sizeBytes = sizeBytes; return this; } - /** + /** * Get sizeBytes * @return sizeBytes - **/ + */ @javax.annotation.Nonnull public Long getSizeBytes() { return sizeBytes; } - public void setSizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; } public ObjectStageCreation mtime(Long mtime) { - this.mtime = mtime; return this; } - /** + /** * Unix Epoch in seconds * @return mtime - **/ + */ @javax.annotation.Nullable public Long getMtime() { return mtime; } - public void setMtime(Long mtime) { this.mtime = mtime; } public ObjectStageCreation metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -183,58 +172,53 @@ public ObjectStageCreation putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } public ObjectStageCreation contentType(String contentType) { - this.contentType = contentType; return this; } - /** + /** * Object media type * @return contentType - **/ + */ @javax.annotation.Nullable public String getContentType() { return contentType; } - public void setContentType(String contentType) { this.contentType = contentType; } public ObjectStageCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -358,12 +342,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("size_bytes"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ObjectStageCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectStageCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectStageCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -417,7 +401,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -456,22 +445,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ObjectStageCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectStageCreation - * @throws IOException if the JSON string is invalid with respect to ObjectStageCreation - */ + /** + * Create an instance of ObjectStageCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectStageCreation + * @throws IOException if the JSON string is invalid with respect to ObjectStageCreation + */ public static ObjectStageCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectStageCreation.class); } - /** - * Convert an instance of ObjectStageCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectStageCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java index f211b1aa9c8..95e395507b5 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStats.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * ObjectStats */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ObjectStats { public static final String SERIALIZED_NAME_PATH = "path"; @SerializedName(SERIALIZED_NAME_PATH) @@ -103,6 +101,11 @@ public PathTypeEnum read(final JsonReader jsonReader) throws IOException { return PathTypeEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PathTypeEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_PATH_TYPE = "path_type"; @@ -141,154 +144,139 @@ public ObjectStats() { } public ObjectStats path(String path) { - this.path = path; return this; } - /** + /** * Get path * @return path - **/ + */ @javax.annotation.Nonnull public String getPath() { return path; } - public void setPath(String path) { this.path = path; } public ObjectStats pathType(PathTypeEnum pathType) { - this.pathType = pathType; return this; } - /** + /** * Get pathType * @return pathType - **/ + */ @javax.annotation.Nonnull public PathTypeEnum getPathType() { return pathType; } - public void setPathType(PathTypeEnum pathType) { this.pathType = pathType; } public ObjectStats physicalAddress(String physicalAddress) { - this.physicalAddress = physicalAddress; return this; } - /** + /** * The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET * @return physicalAddress - **/ + */ @javax.annotation.Nonnull public String getPhysicalAddress() { return physicalAddress; } - public void setPhysicalAddress(String physicalAddress) { this.physicalAddress = physicalAddress; } public ObjectStats physicalAddressExpiry(Long physicalAddressExpiry) { - this.physicalAddressExpiry = physicalAddressExpiry; return this; } - /** + /** * If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. * @return physicalAddressExpiry - **/ + */ @javax.annotation.Nullable public Long getPhysicalAddressExpiry() { return physicalAddressExpiry; } - public void setPhysicalAddressExpiry(Long physicalAddressExpiry) { this.physicalAddressExpiry = physicalAddressExpiry; } public ObjectStats checksum(String checksum) { - this.checksum = checksum; return this; } - /** + /** * Get checksum * @return checksum - **/ + */ @javax.annotation.Nonnull public String getChecksum() { return checksum; } - public void setChecksum(String checksum) { this.checksum = checksum; } public ObjectStats sizeBytes(Long sizeBytes) { - this.sizeBytes = sizeBytes; return this; } - /** + /** * The number of bytes in the object. lakeFS always populates this field when returning ObjectStats. This field is optional _for the client_ to supply, for instance on upload. * @return sizeBytes - **/ + */ @javax.annotation.Nullable public Long getSizeBytes() { return sizeBytes; } - public void setSizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; } public ObjectStats mtime(Long mtime) { - this.mtime = mtime; return this; } - /** + /** * Unix Epoch in seconds * @return mtime - **/ + */ @javax.annotation.Nonnull public Long getMtime() { return mtime; } - public void setMtime(Long mtime) { this.mtime = mtime; } public ObjectStats metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -301,37 +289,34 @@ public ObjectStats putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nullable public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } public ObjectStats contentType(String contentType) { - this.contentType = contentType; return this; } - /** + /** * Object media type * @return contentType - **/ + */ @javax.annotation.Nullable public String getContentType() { return contentType; } - public void setContentType(String contentType) { this.contentType = contentType; } @@ -463,12 +448,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("mtime"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ObjectStats - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectStats + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectStats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -489,6 +474,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("path_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path_type").toString())); } + // validate the required field `path_type` + PathTypeEnum.validateJsonElement(jsonObj.get("path_type")); if (!jsonObj.get("physical_address").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `physical_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("physical_address").toString())); } @@ -528,7 +515,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -567,22 +559,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ObjectStats given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectStats - * @throws IOException if the JSON string is invalid with respect to ObjectStats - */ + /** + * Create an instance of ObjectStats given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectStats + * @throws IOException if the JSON string is invalid with respect to ObjectStats + */ public static ObjectStats fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectStats.class); } - /** - * Convert an instance of ObjectStats to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectStats to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java index 6896ea77522..cb524be6081 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ObjectStatsList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * ObjectStatsList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ObjectStatsList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public ObjectStatsList() { } public ObjectStatsList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public ObjectStatsList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public ObjectStatsList addResultsItem(ObjectStats resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ObjectStatsList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ObjectStatsList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ObjectStatsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ObjectStatsList given an JSON string - * - * @param jsonString JSON string - * @return An instance of ObjectStatsList - * @throws IOException if the JSON string is invalid with respect to ObjectStatsList - */ + /** + * Create an instance of ObjectStatsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectStatsList + * @throws IOException if the JSON string is invalid with respect to ObjectStatsList + */ public static ObjectStatsList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ObjectStatsList.class); } - /** - * Convert an instance of ObjectStatsList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ObjectStatsList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java index 432ee615108..18ed4129e1f 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Pagination.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Pagination */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Pagination { public static final String SERIALIZED_NAME_HAS_MORE = "has_more"; @SerializedName(SERIALIZED_NAME_HAS_MORE) @@ -72,86 +70,78 @@ public Pagination() { } public Pagination hasMore(Boolean hasMore) { - this.hasMore = hasMore; return this; } - /** + /** * Next page is available * @return hasMore - **/ + */ @javax.annotation.Nonnull public Boolean getHasMore() { return hasMore; } - public void setHasMore(Boolean hasMore) { this.hasMore = hasMore; } public Pagination nextOffset(String nextOffset) { - this.nextOffset = nextOffset; return this; } - /** + /** * Token used to retrieve the next page * @return nextOffset - **/ + */ @javax.annotation.Nonnull public String getNextOffset() { return nextOffset; } - public void setNextOffset(String nextOffset) { this.nextOffset = nextOffset; } public Pagination results(Integer results) { - this.results = results; return this; } - /** + /** * Number of values found in the results * minimum: 0 * @return results - **/ + */ @javax.annotation.Nonnull public Integer getResults() { return results; } - public void setResults(Integer results) { this.results = results; } public Pagination maxPerPage(Integer maxPerPage) { - this.maxPerPage = maxPerPage; return this; } - /** + /** * Maximal number of entries per page * minimum: 0 * @return maxPerPage - **/ + */ @javax.annotation.Nonnull public Integer getMaxPerPage() { return maxPerPage; } - public void setMaxPerPage(Integer maxPerPage) { this.maxPerPage = maxPerPage; } @@ -267,12 +257,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("max_per_page"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Pagination - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Pagination + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Pagination.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -320,7 +310,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -359,22 +354,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Pagination given an JSON string - * - * @param jsonString JSON string - * @return An instance of Pagination - * @throws IOException if the JSON string is invalid with respect to Pagination - */ + /** + * Create an instance of Pagination given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pagination + * @throws IOException if the JSON string is invalid with respect to Pagination + */ public static Pagination fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Pagination.class); } - /** - * Convert an instance of Pagination to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Pagination to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java index cc7cf0e938a..904417bcb66 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PathList.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * PathList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class PathList { public static final String SERIALIZED_NAME_PATHS = "paths"; @SerializedName(SERIALIZED_NAME_PATHS) @@ -62,7 +60,6 @@ public PathList() { } public PathList paths(List paths) { - this.paths = paths; return this; } @@ -75,16 +72,15 @@ public PathList addPathsItem(String pathsItem) { return this; } - /** + /** * Get paths * @return paths - **/ + */ @javax.annotation.Nonnull public List getPaths() { return paths; } - public void setPaths(List paths) { this.paths = paths; } @@ -188,12 +184,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("paths"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PathList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PathList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PathList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -244,7 +240,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -283,22 +284,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of PathList given an JSON string - * - * @param jsonString JSON string - * @return An instance of PathList - * @throws IOException if the JSON string is invalid with respect to PathList - */ + /** + * Create an instance of PathList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PathList + * @throws IOException if the JSON string is invalid with respect to PathList + */ public static PathList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PathList.class); } - /** - * Convert an instance of PathList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PathList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java index 39f23f47a6b..cdbaa68e37c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Policy.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * Policy */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Policy { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -71,49 +69,44 @@ public Policy() { } public Policy id(String id) { - this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public Policy creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nullable public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } public Policy statement(List statement) { - this.statement = statement; return this; } @@ -126,16 +119,15 @@ public Policy addStatementItem(Statement statementItem) { return this; } - /** + /** * Get statement * @return statement - **/ + */ @javax.annotation.Nonnull public List getStatement() { return statement; } - public void setStatement(List statement) { this.statement = statement; } @@ -246,12 +238,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("statement"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Policy - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Policy + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Policy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -309,7 +301,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -348,22 +345,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Policy given an JSON string - * - * @param jsonString JSON string - * @return An instance of Policy - * @throws IOException if the JSON string is invalid with respect to Policy - */ + /** + * Create an instance of Policy given an JSON string + * + * @param jsonString JSON string + * @return An instance of Policy + * @throws IOException if the JSON string is invalid with respect to Policy + */ public static Policy fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Policy.class); } - /** - * Convert an instance of Policy to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Policy to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java index 38e73f52473..d663c075bd3 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PolicyList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * PolicyList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class PolicyList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public PolicyList() { } public PolicyList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public PolicyList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public PolicyList addResultsItem(Policy resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PolicyList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PolicyList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PolicyList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of PolicyList given an JSON string - * - * @param jsonString JSON string - * @return An instance of PolicyList - * @throws IOException if the JSON string is invalid with respect to PolicyList - */ + /** + * Create an instance of PolicyList given an JSON string + * + * @param jsonString JSON string + * @return An instance of PolicyList + * @throws IOException if the JSON string is invalid with respect to PolicyList + */ public static PolicyList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PolicyList.class); } - /** - * Convert an instance of PolicyList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PolicyList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java index 30667cb4f72..268cebfad61 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedRequest.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * PrepareGCUncommittedRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class PrepareGCUncommittedRequest { public static final String SERIALIZED_NAME_CONTINUATION_TOKEN = "continuation_token"; @SerializedName(SERIALIZED_NAME_CONTINUATION_TOKEN) @@ -60,21 +58,19 @@ public PrepareGCUncommittedRequest() { } public PrepareGCUncommittedRequest continuationToken(String continuationToken) { - this.continuationToken = continuationToken; return this; } - /** + /** * Get continuationToken * @return continuationToken - **/ + */ @javax.annotation.Nullable public String getContinuationToken() { return continuationToken; } - public void setContinuationToken(String continuationToken) { this.continuationToken = continuationToken; } @@ -177,12 +173,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PrepareGCUncommittedRequest - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PrepareGCUncommittedRequest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PrepareGCUncommittedRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -223,7 +219,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -262,22 +263,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of PrepareGCUncommittedRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of PrepareGCUncommittedRequest - * @throws IOException if the JSON string is invalid with respect to PrepareGCUncommittedRequest - */ + /** + * Create an instance of PrepareGCUncommittedRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrepareGCUncommittedRequest + * @throws IOException if the JSON string is invalid with respect to PrepareGCUncommittedRequest + */ public static PrepareGCUncommittedRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PrepareGCUncommittedRequest.class); } - /** - * Convert an instance of PrepareGCUncommittedRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PrepareGCUncommittedRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java index 0a0d2cfcf27..72547949bee 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PrepareGCUncommittedResponse.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * PrepareGCUncommittedResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class PrepareGCUncommittedResponse { public static final String SERIALIZED_NAME_RUN_ID = "run_id"; @SerializedName(SERIALIZED_NAME_RUN_ID) @@ -68,63 +66,57 @@ public PrepareGCUncommittedResponse() { } public PrepareGCUncommittedResponse runId(String runId) { - this.runId = runId; return this; } - /** + /** * Get runId * @return runId - **/ + */ @javax.annotation.Nonnull public String getRunId() { return runId; } - public void setRunId(String runId) { this.runId = runId; } public PrepareGCUncommittedResponse gcUncommittedLocation(String gcUncommittedLocation) { - this.gcUncommittedLocation = gcUncommittedLocation; return this; } - /** + /** * location of uncommitted information data * @return gcUncommittedLocation - **/ + */ @javax.annotation.Nonnull public String getGcUncommittedLocation() { return gcUncommittedLocation; } - public void setGcUncommittedLocation(String gcUncommittedLocation) { this.gcUncommittedLocation = gcUncommittedLocation; } public PrepareGCUncommittedResponse continuationToken(String continuationToken) { - this.continuationToken = continuationToken; return this; } - /** + /** * Get continuationToken * @return continuationToken - **/ + */ @javax.annotation.Nullable public String getContinuationToken() { return continuationToken; } - public void setContinuationToken(String continuationToken) { this.continuationToken = continuationToken; } @@ -235,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("gc_uncommitted_location"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PrepareGCUncommittedResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PrepareGCUncommittedResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PrepareGCUncommittedResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -294,7 +286,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -333,22 +330,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of PrepareGCUncommittedResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of PrepareGCUncommittedResponse - * @throws IOException if the JSON string is invalid with respect to PrepareGCUncommittedResponse - */ + /** + * Create an instance of PrepareGCUncommittedResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrepareGCUncommittedResponse + * @throws IOException if the JSON string is invalid with respect to PrepareGCUncommittedResponse + */ public static PrepareGCUncommittedResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PrepareGCUncommittedResponse.class); } - /** - * Convert an instance of PrepareGCUncommittedResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PrepareGCUncommittedResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PresignMultipartUpload.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PresignMultipartUpload.java index d054f818434..a9d832b1417 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/PresignMultipartUpload.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/PresignMultipartUpload.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * PresignMultipartUpload */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class PresignMultipartUpload { public static final String SERIALIZED_NAME_UPLOAD_ID = "upload_id"; @SerializedName(SERIALIZED_NAME_UPLOAD_ID) @@ -64,55 +62,50 @@ public class PresignMultipartUpload { public static final String SERIALIZED_NAME_PRESIGNED_URLS = "presigned_urls"; @SerializedName(SERIALIZED_NAME_PRESIGNED_URLS) - private List presignedUrls; + private List presignedUrls = new ArrayList<>(); public PresignMultipartUpload() { } public PresignMultipartUpload uploadId(String uploadId) { - this.uploadId = uploadId; return this; } - /** + /** * Get uploadId * @return uploadId - **/ + */ @javax.annotation.Nonnull public String getUploadId() { return uploadId; } - public void setUploadId(String uploadId) { this.uploadId = uploadId; } public PresignMultipartUpload physicalAddress(String physicalAddress) { - this.physicalAddress = physicalAddress; return this; } - /** + /** * Get physicalAddress * @return physicalAddress - **/ + */ @javax.annotation.Nonnull public String getPhysicalAddress() { return physicalAddress; } - public void setPhysicalAddress(String physicalAddress) { this.physicalAddress = physicalAddress; } public PresignMultipartUpload presignedUrls(List presignedUrls) { - this.presignedUrls = presignedUrls; return this; } @@ -125,16 +118,15 @@ public PresignMultipartUpload addPresignedUrlsItem(String presignedUrlsItem) { return this; } - /** + /** * Get presignedUrls * @return presignedUrls - **/ + */ @javax.annotation.Nullable public List getPresignedUrls() { return presignedUrls; } - public void setPresignedUrls(List presignedUrls) { this.presignedUrls = presignedUrls; } @@ -245,12 +237,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("physical_address"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to PresignMultipartUpload - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PresignMultipartUpload + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!PresignMultipartUpload.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -305,7 +297,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -344,22 +341,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of PresignMultipartUpload given an JSON string - * - * @param jsonString JSON string - * @return An instance of PresignMultipartUpload - * @throws IOException if the JSON string is invalid with respect to PresignMultipartUpload - */ + /** + * Create an instance of PresignMultipartUpload given an JSON string + * + * @param jsonString JSON string + * @return An instance of PresignMultipartUpload + * @throws IOException if the JSON string is invalid with respect to PresignMultipartUpload + */ public static PresignMultipartUpload fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, PresignMultipartUpload.class); } - /** - * Convert an instance of PresignMultipartUpload to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of PresignMultipartUpload to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java index 0b199ff5237..8bd1cf093a1 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RangeMetadata.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * RangeMetadata */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RangeMetadata { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -76,105 +74,95 @@ public RangeMetadata() { } public RangeMetadata id(String id) { - this.id = id; return this; } - /** + /** * ID of the range. * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public RangeMetadata minKey(String minKey) { - this.minKey = minKey; return this; } - /** + /** * First key in the range. * @return minKey - **/ + */ @javax.annotation.Nonnull public String getMinKey() { return minKey; } - public void setMinKey(String minKey) { this.minKey = minKey; } public RangeMetadata maxKey(String maxKey) { - this.maxKey = maxKey; return this; } - /** + /** * Last key in the range. * @return maxKey - **/ + */ @javax.annotation.Nonnull public String getMaxKey() { return maxKey; } - public void setMaxKey(String maxKey) { this.maxKey = maxKey; } public RangeMetadata count(Integer count) { - this.count = count; return this; } - /** + /** * Number of records in the range. * @return count - **/ + */ @javax.annotation.Nonnull public Integer getCount() { return count; } - public void setCount(Integer count) { this.count = count; } public RangeMetadata estimatedSize(Integer estimatedSize) { - this.estimatedSize = estimatedSize; return this; } - /** + /** * Estimated size of the range in bytes * @return estimatedSize - **/ + */ @javax.annotation.Nonnull public Integer getEstimatedSize() { return estimatedSize; } - public void setEstimatedSize(Integer estimatedSize) { this.estimatedSize = estimatedSize; } @@ -294,12 +282,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("estimated_size"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RangeMetadata - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RangeMetadata + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RangeMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -353,7 +341,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -392,22 +385,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RangeMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of RangeMetadata - * @throws IOException if the JSON string is invalid with respect to RangeMetadata - */ + /** + * Create an instance of RangeMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of RangeMetadata + * @throws IOException if the JSON string is invalid with respect to RangeMetadata + */ public static RangeMetadata fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RangeMetadata.class); } - /** - * Convert an instance of RangeMetadata to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RangeMetadata to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java index 58676fc5785..230d6104751 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Ref.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Ref */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Ref { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -64,42 +62,38 @@ public Ref() { } public Ref id(String id) { - this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public Ref commitId(String commitId) { - this.commitId = commitId; return this; } - /** + /** * Get commitId * @return commitId - **/ + */ @javax.annotation.Nonnull public String getCommitId() { return commitId; } - public void setCommitId(String commitId) { this.commitId = commitId; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("commit_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Ref - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Ref + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Ref.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -263,7 +257,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -302,22 +301,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Ref given an JSON string - * - * @param jsonString JSON string - * @return An instance of Ref - * @throws IOException if the JSON string is invalid with respect to Ref - */ + /** + * Create an instance of Ref given an JSON string + * + * @param jsonString JSON string + * @return An instance of Ref + * @throws IOException if the JSON string is invalid with respect to Ref + */ public static Ref fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Ref.class); } - /** - * Convert an instance of Ref to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Ref to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java index 2e07cd35630..7f749ccd4a5 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * RefList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RefList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public RefList() { } public RefList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public RefList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public RefList addResultsItem(Ref resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RefList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RefList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RefList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RefList given an JSON string - * - * @param jsonString JSON string - * @return An instance of RefList - * @throws IOException if the JSON string is invalid with respect to RefList - */ + /** + * Create an instance of RefList given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefList + * @throws IOException if the JSON string is invalid with respect to RefList + */ public static RefList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RefList.class); } - /** - * Convert an instance of RefList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RefList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java index 9ff656394cc..dd469cdbd5f 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsDump.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * RefsDump */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RefsDump { public static final String SERIALIZED_NAME_COMMITS_META_RANGE_ID = "commits_meta_range_id"; @SerializedName(SERIALIZED_NAME_COMMITS_META_RANGE_ID) @@ -68,63 +66,57 @@ public RefsDump() { } public RefsDump commitsMetaRangeId(String commitsMetaRangeId) { - this.commitsMetaRangeId = commitsMetaRangeId; return this; } - /** + /** * Get commitsMetaRangeId * @return commitsMetaRangeId - **/ + */ @javax.annotation.Nonnull public String getCommitsMetaRangeId() { return commitsMetaRangeId; } - public void setCommitsMetaRangeId(String commitsMetaRangeId) { this.commitsMetaRangeId = commitsMetaRangeId; } public RefsDump tagsMetaRangeId(String tagsMetaRangeId) { - this.tagsMetaRangeId = tagsMetaRangeId; return this; } - /** + /** * Get tagsMetaRangeId * @return tagsMetaRangeId - **/ + */ @javax.annotation.Nonnull public String getTagsMetaRangeId() { return tagsMetaRangeId; } - public void setTagsMetaRangeId(String tagsMetaRangeId) { this.tagsMetaRangeId = tagsMetaRangeId; } public RefsDump branchesMetaRangeId(String branchesMetaRangeId) { - this.branchesMetaRangeId = branchesMetaRangeId; return this; } - /** + /** * Get branchesMetaRangeId * @return branchesMetaRangeId - **/ + */ @javax.annotation.Nonnull public String getBranchesMetaRangeId() { return branchesMetaRangeId; } - public void setBranchesMetaRangeId(String branchesMetaRangeId) { this.branchesMetaRangeId = branchesMetaRangeId; } @@ -236,12 +228,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("branches_meta_range_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RefsDump - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RefsDump + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RefsDump.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -295,7 +287,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -334,22 +331,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RefsDump given an JSON string - * - * @param jsonString JSON string - * @return An instance of RefsDump - * @throws IOException if the JSON string is invalid with respect to RefsDump - */ + /** + * Create an instance of RefsDump given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefsDump + * @throws IOException if the JSON string is invalid with respect to RefsDump + */ public static RefsDump fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RefsDump.class); } - /** - * Convert an instance of RefsDump to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RefsDump to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsRestore.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsRestore.java index ce08b195aa0..756910dfbab 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsRestore.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RefsRestore.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * RefsRestore */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RefsRestore { public static final String SERIALIZED_NAME_COMMITS_META_RANGE_ID = "commits_meta_range_id"; @SerializedName(SERIALIZED_NAME_COMMITS_META_RANGE_ID) @@ -72,84 +70,76 @@ public RefsRestore() { } public RefsRestore commitsMetaRangeId(String commitsMetaRangeId) { - this.commitsMetaRangeId = commitsMetaRangeId; return this; } - /** + /** * Get commitsMetaRangeId * @return commitsMetaRangeId - **/ + */ @javax.annotation.Nonnull public String getCommitsMetaRangeId() { return commitsMetaRangeId; } - public void setCommitsMetaRangeId(String commitsMetaRangeId) { this.commitsMetaRangeId = commitsMetaRangeId; } public RefsRestore tagsMetaRangeId(String tagsMetaRangeId) { - this.tagsMetaRangeId = tagsMetaRangeId; return this; } - /** + /** * Get tagsMetaRangeId * @return tagsMetaRangeId - **/ + */ @javax.annotation.Nonnull public String getTagsMetaRangeId() { return tagsMetaRangeId; } - public void setTagsMetaRangeId(String tagsMetaRangeId) { this.tagsMetaRangeId = tagsMetaRangeId; } public RefsRestore branchesMetaRangeId(String branchesMetaRangeId) { - this.branchesMetaRangeId = branchesMetaRangeId; return this; } - /** + /** * Get branchesMetaRangeId * @return branchesMetaRangeId - **/ + */ @javax.annotation.Nonnull public String getBranchesMetaRangeId() { return branchesMetaRangeId; } - public void setBranchesMetaRangeId(String branchesMetaRangeId) { this.branchesMetaRangeId = branchesMetaRangeId; } public RefsRestore force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -264,12 +254,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("branches_meta_range_id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RefsRestore - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RefsRestore + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RefsRestore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -323,7 +313,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -362,22 +357,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RefsRestore given an JSON string - * - * @param jsonString JSON string - * @return An instance of RefsRestore - * @throws IOException if the JSON string is invalid with respect to RefsRestore - */ + /** + * Create an instance of RefsRestore given an JSON string + * + * @param jsonString JSON string + * @return An instance of RefsRestore + * @throws IOException if the JSON string is invalid with respect to RefsRestore + */ public static RefsRestore fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RefsRestore.class); } - /** - * Convert an instance of RefsRestore to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RefsRestore to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java index 4978119e72b..ad9e1318255 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Repository.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Repository */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Repository { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -76,105 +74,95 @@ public Repository() { } public Repository id(String id) { - this.id = id; return this; } - /** + /** * Get id * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public Repository creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } public Repository defaultBranch(String defaultBranch) { - this.defaultBranch = defaultBranch; return this; } - /** + /** * Get defaultBranch * @return defaultBranch - **/ + */ @javax.annotation.Nonnull public String getDefaultBranch() { return defaultBranch; } - public void setDefaultBranch(String defaultBranch) { this.defaultBranch = defaultBranch; } public Repository storageNamespace(String storageNamespace) { - this.storageNamespace = storageNamespace; return this; } - /** + /** * Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") * @return storageNamespace - **/ + */ @javax.annotation.Nonnull public String getStorageNamespace() { return storageNamespace; } - public void setStorageNamespace(String storageNamespace) { this.storageNamespace = storageNamespace; } public Repository readOnly(Boolean readOnly) { - this.readOnly = readOnly; return this; } - /** + /** * Whether the repository is a read-only repository- not relevant for bare repositories * @return readOnly - **/ + */ @javax.annotation.Nullable public Boolean getReadOnly() { return readOnly; } - public void setReadOnly(Boolean readOnly) { this.readOnly = readOnly; } @@ -293,12 +281,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("storage_namespace"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Repository - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Repository + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Repository.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -352,7 +340,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -391,22 +384,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Repository given an JSON string - * - * @param jsonString JSON string - * @return An instance of Repository - * @throws IOException if the JSON string is invalid with respect to Repository - */ + /** + * Create an instance of Repository given an JSON string + * + * @param jsonString JSON string + * @return An instance of Repository + * @throws IOException if the JSON string is invalid with respect to Repository + */ public static Repository fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Repository.class); } - /** - * Convert an instance of Repository to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Repository to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java index fdbf5b1e8ec..05cf7b942b3 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * RepositoryCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RepositoryCreation { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -76,105 +74,95 @@ public RepositoryCreation() { } public RepositoryCreation name(String name) { - this.name = name; return this; } - /** + /** * Get name * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; } - public void setName(String name) { this.name = name; } public RepositoryCreation storageNamespace(String storageNamespace) { - this.storageNamespace = storageNamespace; return this; } - /** + /** * Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\") * @return storageNamespace - **/ + */ @javax.annotation.Nonnull public String getStorageNamespace() { return storageNamespace; } - public void setStorageNamespace(String storageNamespace) { this.storageNamespace = storageNamespace; } public RepositoryCreation defaultBranch(String defaultBranch) { - this.defaultBranch = defaultBranch; return this; } - /** + /** * Get defaultBranch * @return defaultBranch - **/ + */ @javax.annotation.Nullable public String getDefaultBranch() { return defaultBranch; } - public void setDefaultBranch(String defaultBranch) { this.defaultBranch = defaultBranch; } public RepositoryCreation sampleData(Boolean sampleData) { - this.sampleData = sampleData; return this; } - /** + /** * Get sampleData * @return sampleData - **/ + */ @javax.annotation.Nullable public Boolean getSampleData() { return sampleData; } - public void setSampleData(Boolean sampleData) { this.sampleData = sampleData; } public RepositoryCreation readOnly(Boolean readOnly) { - this.readOnly = readOnly; return this; } - /** + /** * Get readOnly * @return readOnly - **/ + */ @javax.annotation.Nullable public Boolean getReadOnly() { return readOnly; } - public void setReadOnly(Boolean readOnly) { this.readOnly = readOnly; } @@ -291,12 +279,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("storage_namespace"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RepositoryCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RepositoryCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -350,7 +338,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -389,22 +382,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RepositoryCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepositoryCreation - * @throws IOException if the JSON string is invalid with respect to RepositoryCreation - */ + /** + * Create an instance of RepositoryCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryCreation + * @throws IOException if the JSON string is invalid with respect to RepositoryCreation + */ public static RepositoryCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RepositoryCreation.class); } - /** - * Convert an instance of RepositoryCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RepositoryCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryDumpStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryDumpStatus.java index bcfcbd301b4..77ad78d9ab8 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryDumpStatus.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryDumpStatus.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * RepositoryDumpStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RepositoryDumpStatus { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -78,105 +76,95 @@ public RepositoryDumpStatus() { } public RepositoryDumpStatus id(String id) { - this.id = id; return this; } - /** + /** * ID of the task * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public RepositoryDumpStatus done(Boolean done) { - this.done = done; return this; } - /** + /** * Get done * @return done - **/ + */ @javax.annotation.Nonnull public Boolean getDone() { return done; } - public void setDone(Boolean done) { this.done = done; } public RepositoryDumpStatus updateTime(OffsetDateTime updateTime) { - this.updateTime = updateTime; return this; } - /** + /** * Get updateTime * @return updateTime - **/ + */ @javax.annotation.Nonnull public OffsetDateTime getUpdateTime() { return updateTime; } - public void setUpdateTime(OffsetDateTime updateTime) { this.updateTime = updateTime; } public RepositoryDumpStatus error(String error) { - this.error = error; return this; } - /** + /** * Get error * @return error - **/ + */ @javax.annotation.Nullable public String getError() { return error; } - public void setError(String error) { this.error = error; } public RepositoryDumpStatus refs(RefsDump refs) { - this.refs = refs; return this; } - /** + /** * Get refs * @return refs - **/ + */ @javax.annotation.Nullable public RefsDump getRefs() { return refs; } - public void setRefs(RefsDump refs) { this.refs = refs; } @@ -294,12 +282,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("update_time"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RepositoryDumpStatus - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryDumpStatus + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RepositoryDumpStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -354,7 +342,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -393,22 +386,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RepositoryDumpStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepositoryDumpStatus - * @throws IOException if the JSON string is invalid with respect to RepositoryDumpStatus - */ + /** + * Create an instance of RepositoryDumpStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryDumpStatus + * @throws IOException if the JSON string is invalid with respect to RepositoryDumpStatus + */ public static RepositoryDumpStatus fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RepositoryDumpStatus.class); } - /** - * Convert an instance of RepositoryDumpStatus to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RepositoryDumpStatus to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java index bba2a43f1c9..f102ca3f8b4 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * RepositoryList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RepositoryList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public RepositoryList() { } public RepositoryList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public RepositoryList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public RepositoryList addResultsItem(Repository resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RepositoryList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RepositoryList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RepositoryList given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepositoryList - * @throws IOException if the JSON string is invalid with respect to RepositoryList - */ + /** + * Create an instance of RepositoryList given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryList + * @throws IOException if the JSON string is invalid with respect to RepositoryList + */ public static RepositoryList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RepositoryList.class); } - /** - * Convert an instance of RepositoryList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RepositoryList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataKeys.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataKeys.java index d55510631cf..39705589c47 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataKeys.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataKeys.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * RepositoryMetadataKeys */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RepositoryMetadataKeys { public static final String SERIALIZED_NAME_KEYS = "keys"; @SerializedName(SERIALIZED_NAME_KEYS) @@ -62,7 +60,6 @@ public RepositoryMetadataKeys() { } public RepositoryMetadataKeys keys(List keys) { - this.keys = keys; return this; } @@ -75,16 +72,15 @@ public RepositoryMetadataKeys addKeysItem(String keysItem) { return this; } - /** + /** * Get keys * @return keys - **/ + */ @javax.annotation.Nonnull public List getKeys() { return keys; } - public void setKeys(List keys) { this.keys = keys; } @@ -188,12 +184,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("keys"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RepositoryMetadataKeys - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryMetadataKeys + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RepositoryMetadataKeys.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -244,7 +240,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -283,22 +284,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RepositoryMetadataKeys given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepositoryMetadataKeys - * @throws IOException if the JSON string is invalid with respect to RepositoryMetadataKeys - */ + /** + * Create an instance of RepositoryMetadataKeys given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryMetadataKeys + * @throws IOException if the JSON string is invalid with respect to RepositoryMetadataKeys + */ public static RepositoryMetadataKeys fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RepositoryMetadataKeys.class); } - /** - * Convert an instance of RepositoryMetadataKeys to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RepositoryMetadataKeys to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataSet.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataSet.java index 0d42138d12e..c5aa182fa69 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataSet.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryMetadataSet.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * RepositoryMetadataSet */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RepositoryMetadataSet { public static final String SERIALIZED_NAME_METADATA = "metadata"; @SerializedName(SERIALIZED_NAME_METADATA) @@ -62,7 +60,6 @@ public RepositoryMetadataSet() { } public RepositoryMetadataSet metadata(Map metadata) { - this.metadata = metadata; return this; } @@ -75,16 +72,15 @@ public RepositoryMetadataSet putMetadataItem(String key, String metadataItem) { return this; } - /** + /** * Get metadata * @return metadata - **/ + */ @javax.annotation.Nonnull public Map getMetadata() { return metadata; } - public void setMetadata(Map metadata) { this.metadata = metadata; } @@ -188,12 +184,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("metadata"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RepositoryMetadataSet - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryMetadataSet + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RepositoryMetadataSet.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -238,7 +234,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -277,22 +278,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RepositoryMetadataSet given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepositoryMetadataSet - * @throws IOException if the JSON string is invalid with respect to RepositoryMetadataSet - */ + /** + * Create an instance of RepositoryMetadataSet given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryMetadataSet + * @throws IOException if the JSON string is invalid with respect to RepositoryMetadataSet + */ public static RepositoryMetadataSet fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RepositoryMetadataSet.class); } - /** - * Convert an instance of RepositoryMetadataSet to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RepositoryMetadataSet to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryRestoreStatus.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryRestoreStatus.java index b9b9656949b..dbbbeb51e25 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryRestoreStatus.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RepositoryRestoreStatus.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * RepositoryRestoreStatus */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RepositoryRestoreStatus { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -73,84 +71,76 @@ public RepositoryRestoreStatus() { } public RepositoryRestoreStatus id(String id) { - this.id = id; return this; } - /** + /** * ID of the task * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public RepositoryRestoreStatus done(Boolean done) { - this.done = done; return this; } - /** + /** * Get done * @return done - **/ + */ @javax.annotation.Nonnull public Boolean getDone() { return done; } - public void setDone(Boolean done) { this.done = done; } public RepositoryRestoreStatus updateTime(OffsetDateTime updateTime) { - this.updateTime = updateTime; return this; } - /** + /** * Get updateTime * @return updateTime - **/ + */ @javax.annotation.Nonnull public OffsetDateTime getUpdateTime() { return updateTime; } - public void setUpdateTime(OffsetDateTime updateTime) { this.updateTime = updateTime; } public RepositoryRestoreStatus error(String error) { - this.error = error; return this; } - /** + /** * Get error * @return error - **/ + */ @javax.annotation.Nullable public String getError() { return error; } - public void setError(String error) { this.error = error; } @@ -265,12 +255,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("update_time"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RepositoryRestoreStatus - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RepositoryRestoreStatus + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RepositoryRestoreStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -321,7 +311,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -360,22 +355,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RepositoryRestoreStatus given an JSON string - * - * @param jsonString JSON string - * @return An instance of RepositoryRestoreStatus - * @throws IOException if the JSON string is invalid with respect to RepositoryRestoreStatus - */ + /** + * Create an instance of RepositoryRestoreStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepositoryRestoreStatus + * @throws IOException if the JSON string is invalid with respect to RepositoryRestoreStatus + */ public static RepositoryRestoreStatus fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RepositoryRestoreStatus.class); } - /** - * Convert an instance of RepositoryRestoreStatus to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RepositoryRestoreStatus to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java index 914adfb53bb..2475b4563c1 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/ResetCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * ResetCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class ResetCreation { /** * What to reset according to path. @@ -99,6 +97,11 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { return TypeEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_TYPE = "type"; @@ -117,63 +120,57 @@ public ResetCreation() { } public ResetCreation type(TypeEnum type) { - this.type = type; return this; } - /** + /** * What to reset according to path. * @return type - **/ + */ @javax.annotation.Nonnull public TypeEnum getType() { return type; } - public void setType(TypeEnum type) { this.type = type; } public ResetCreation path(String path) { - this.path = path; return this; } - /** + /** * Get path * @return path - **/ + */ @javax.annotation.Nullable public String getPath() { return path; } - public void setPath(String path) { this.path = path; } public ResetCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -283,12 +280,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("type"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ResetCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ResetCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ResetCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -306,6 +303,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); } @@ -339,7 +338,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -378,22 +382,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of ResetCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of ResetCreation - * @throws IOException if the JSON string is invalid with respect to ResetCreation - */ + /** + * Create an instance of ResetCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetCreation + * @throws IOException if the JSON string is invalid with respect to ResetCreation + */ public static ResetCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ResetCreation.class); } - /** - * Convert an instance of ResetCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ResetCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java index 25994cd4654..68bc393664a 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/RevertCreation.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * RevertCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class RevertCreation { public static final String SERIALIZED_NAME_REF = "ref"; @SerializedName(SERIALIZED_NAME_REF) @@ -77,105 +75,95 @@ public RevertCreation() { } public RevertCreation ref(String ref) { - this.ref = ref; return this; } - /** + /** * the commit to revert, given by a ref * @return ref - **/ + */ @javax.annotation.Nonnull public String getRef() { return ref; } - public void setRef(String ref) { this.ref = ref; } public RevertCreation commitOverrides(CommitOverrides commitOverrides) { - this.commitOverrides = commitOverrides; return this; } - /** + /** * Get commitOverrides * @return commitOverrides - **/ + */ @javax.annotation.Nullable public CommitOverrides getCommitOverrides() { return commitOverrides; } - public void setCommitOverrides(CommitOverrides commitOverrides) { this.commitOverrides = commitOverrides; } public RevertCreation parentNumber(Integer parentNumber) { - this.parentNumber = parentNumber; return this; } - /** + /** * when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. * @return parentNumber - **/ + */ @javax.annotation.Nonnull public Integer getParentNumber() { return parentNumber; } - public void setParentNumber(Integer parentNumber) { this.parentNumber = parentNumber; } public RevertCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } public RevertCreation allowEmpty(Boolean allowEmpty) { - this.allowEmpty = allowEmpty; return this; } - /** + /** * allow empty commit (revert without changes) * @return allowEmpty - **/ + */ @javax.annotation.Nullable public Boolean getAllowEmpty() { return allowEmpty; } - public void setAllowEmpty(Boolean allowEmpty) { this.allowEmpty = allowEmpty; } @@ -292,12 +280,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("parent_number"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RevertCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RevertCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RevertCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -349,7 +337,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -388,22 +381,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of RevertCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of RevertCreation - * @throws IOException if the JSON string is invalid with respect to RevertCreation - */ + /** + * Create an instance of RevertCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of RevertCreation + * @throws IOException if the JSON string is invalid with respect to RevertCreation + */ public static RevertCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RevertCreation.class); } - /** - * Convert an instance of RevertCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RevertCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java index cb4eeb09fce..c1297201dcb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Setup.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * Setup */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Setup { public static final String SERIALIZED_NAME_USERNAME = "username"; @SerializedName(SERIALIZED_NAME_USERNAME) @@ -65,42 +63,38 @@ public Setup() { } public Setup username(String username) { - this.username = username; return this; } - /** + /** * an identifier for the user (e.g. jane.doe) * @return username - **/ + */ @javax.annotation.Nonnull public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } public Setup key(AccessKeyCredentials key) { - this.key = key; return this; } - /** + /** * Get key * @return key - **/ + */ @javax.annotation.Nullable public AccessKeyCredentials getKey() { return key; } - public void setKey(AccessKeyCredentials key) { this.key = key; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("username"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Setup - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Setup + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Setup.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -264,7 +258,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -303,22 +302,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Setup given an JSON string - * - * @param jsonString JSON string - * @return An instance of Setup - * @throws IOException if the JSON string is invalid with respect to Setup - */ + /** + * Create an instance of Setup given an JSON string + * + * @param jsonString JSON string + * @return An instance of Setup + * @throws IOException if the JSON string is invalid with respect to Setup + */ public static Setup fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Setup.class); } - /** - * Convert an instance of Setup to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Setup to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java index 20269e4439d..55ced1d1a24 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/SetupState.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * SetupState */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class SetupState { /** * Gets or Sets state @@ -98,6 +96,11 @@ public StateEnum read(final JsonReader jsonReader) throws IOException { return StateEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StateEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_STATE = "state"; @@ -116,63 +119,57 @@ public SetupState() { } public SetupState state(StateEnum state) { - this.state = state; return this; } - /** + /** * Get state * @return state - **/ + */ @javax.annotation.Nullable public StateEnum getState() { return state; } - public void setState(StateEnum state) { this.state = state; } public SetupState commPrefsMissing(Boolean commPrefsMissing) { - this.commPrefsMissing = commPrefsMissing; return this; } - /** + /** * true if the comm prefs are missing. * @return commPrefsMissing - **/ + */ @javax.annotation.Nullable public Boolean getCommPrefsMissing() { return commPrefsMissing; } - public void setCommPrefsMissing(Boolean commPrefsMissing) { this.commPrefsMissing = commPrefsMissing; } public SetupState loginConfig(LoginConfig loginConfig) { - this.loginConfig = loginConfig; return this; } - /** + /** * Get loginConfig * @return loginConfig - **/ + */ @javax.annotation.Nullable public LoginConfig getLoginConfig() { return loginConfig; } - public void setLoginConfig(LoginConfig loginConfig) { this.loginConfig = loginConfig; } @@ -281,12 +278,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SetupState - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SetupState + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SetupState.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -297,6 +294,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); } + // validate the optional field `state` + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) { + StateEnum.validateJsonElement(jsonObj.get("state")); + } // validate the optional field `login_config` if (jsonObj.get("login_config") != null && !jsonObj.get("login_config").isJsonNull()) { LoginConfig.validateJsonElement(jsonObj.get("login_config")); @@ -331,7 +332,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -370,22 +376,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of SetupState given an JSON string - * - * @param jsonString JSON string - * @return An instance of SetupState - * @throws IOException if the JSON string is invalid with respect to SetupState - */ + /** + * Create an instance of SetupState given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetupState + * @throws IOException if the JSON string is invalid with respect to SetupState + */ public static SetupState fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SetupState.class); } - /** - * Convert an instance of SetupState to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SetupState to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java index 1fbd994ca3d..dda9343b56b 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingLocation.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * location for placing an object when staging it */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StagingLocation { public static final String SERIALIZED_NAME_PHYSICAL_ADDRESS = "physical_address"; @SerializedName(SERIALIZED_NAME_PHYSICAL_ADDRESS) @@ -69,63 +67,57 @@ public StagingLocation() { } public StagingLocation physicalAddress(String physicalAddress) { - this.physicalAddress = physicalAddress; return this; } - /** + /** * Get physicalAddress * @return physicalAddress - **/ + */ @javax.annotation.Nullable public String getPhysicalAddress() { return physicalAddress; } - public void setPhysicalAddress(String physicalAddress) { this.physicalAddress = physicalAddress; } public StagingLocation presignedUrl(String presignedUrl) { - this.presignedUrl = presignedUrl; return this; } - /** + /** * if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading * @return presignedUrl - **/ + */ @javax.annotation.Nullable public String getPresignedUrl() { return presignedUrl; } - public void setPresignedUrl(String presignedUrl) { this.presignedUrl = presignedUrl; } public StagingLocation presignedUrlExpiry(Long presignedUrlExpiry) { - this.presignedUrlExpiry = presignedUrlExpiry; return this; } - /** + /** * If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. * @return presignedUrlExpiry - **/ + */ @javax.annotation.Nullable public Long getPresignedUrlExpiry() { return presignedUrlExpiry; } - public void setPresignedUrlExpiry(Long presignedUrlExpiry) { this.presignedUrlExpiry = presignedUrlExpiry; } @@ -245,12 +237,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StagingLocation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StagingLocation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StagingLocation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -294,7 +286,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -333,22 +330,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StagingLocation given an JSON string - * - * @param jsonString JSON string - * @return An instance of StagingLocation - * @throws IOException if the JSON string is invalid with respect to StagingLocation - */ + /** + * Create an instance of StagingLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of StagingLocation + * @throws IOException if the JSON string is invalid with respect to StagingLocation + */ public static StagingLocation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StagingLocation.class); } - /** - * Convert an instance of StagingLocation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StagingLocation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java index 0e6ad6001c4..4d502a117de 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StagingMetadata.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * information about uploaded object */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StagingMetadata { public static final String SERIALIZED_NAME_STAGING = "staging"; @SerializedName(SERIALIZED_NAME_STAGING) @@ -83,70 +81,63 @@ public StagingMetadata() { } public StagingMetadata staging(StagingLocation staging) { - this.staging = staging; return this; } - /** + /** * Get staging * @return staging - **/ + */ @javax.annotation.Nonnull public StagingLocation getStaging() { return staging; } - public void setStaging(StagingLocation staging) { this.staging = staging; } public StagingMetadata checksum(String checksum) { - this.checksum = checksum; return this; } - /** + /** * unique identifier of object content on backing store (typically ETag) * @return checksum - **/ + */ @javax.annotation.Nonnull public String getChecksum() { return checksum; } - public void setChecksum(String checksum) { this.checksum = checksum; } public StagingMetadata sizeBytes(Long sizeBytes) { - this.sizeBytes = sizeBytes; return this; } - /** + /** * Get sizeBytes * @return sizeBytes - **/ + */ @javax.annotation.Nonnull public Long getSizeBytes() { return sizeBytes; } - public void setSizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; } public StagingMetadata userMetadata(Map userMetadata) { - this.userMetadata = userMetadata; return this; } @@ -159,58 +150,53 @@ public StagingMetadata putUserMetadataItem(String key, String userMetadataItem) return this; } - /** + /** * Get userMetadata * @return userMetadata - **/ + */ @javax.annotation.Nullable public Map getUserMetadata() { return userMetadata; } - public void setUserMetadata(Map userMetadata) { this.userMetadata = userMetadata; } public StagingMetadata contentType(String contentType) { - this.contentType = contentType; return this; } - /** + /** * Object media type * @return contentType - **/ + */ @javax.annotation.Nullable public String getContentType() { return contentType; } - public void setContentType(String contentType) { this.contentType = contentType; } public StagingMetadata force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -331,12 +317,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("size_bytes"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StagingMetadata - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StagingMetadata + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StagingMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -389,7 +375,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -428,22 +419,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StagingMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of StagingMetadata - * @throws IOException if the JSON string is invalid with respect to StagingMetadata - */ + /** + * Create an instance of StagingMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of StagingMetadata + * @throws IOException if the JSON string is invalid with respect to StagingMetadata + */ public static StagingMetadata fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StagingMetadata.class); } - /** - * Convert an instance of StagingMetadata to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StagingMetadata to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java index 6274cbfb8bc..b255ac7e9b9 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/Statement.java @@ -39,12 +39,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -52,7 +50,7 @@ /** * Statement */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class Statement { /** * Gets or Sets effect @@ -99,6 +97,11 @@ public EffectEnum read(final JsonReader jsonReader) throws IOException { return EffectEnum.fromValue(value); } } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EffectEnum.fromValue(value); + } } public static final String SERIALIZED_NAME_EFFECT = "effect"; @@ -117,49 +120,44 @@ public Statement() { } public Statement effect(EffectEnum effect) { - this.effect = effect; return this; } - /** + /** * Get effect * @return effect - **/ + */ @javax.annotation.Nonnull public EffectEnum getEffect() { return effect; } - public void setEffect(EffectEnum effect) { this.effect = effect; } public Statement resource(String resource) { - this.resource = resource; return this; } - /** + /** * Get resource * @return resource - **/ + */ @javax.annotation.Nonnull public String getResource() { return resource; } - public void setResource(String resource) { this.resource = resource; } public Statement action(List action) { - this.action = action; return this; } @@ -172,16 +170,15 @@ public Statement addActionItem(String actionItem) { return this; } - /** + /** * Get action * @return action - **/ + */ @javax.annotation.Nonnull public List getAction() { return action; } - public void setAction(List action) { this.action = action; } @@ -293,12 +290,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("action"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Statement - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Statement + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Statement.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -316,6 +313,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (!jsonObj.get("effect").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `effect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("effect").toString())); } + // validate the required field `effect` + EffectEnum.validateJsonElement(jsonObj.get("effect")); if (!jsonObj.get("resource").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `resource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource").toString())); } @@ -355,7 +354,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -394,22 +398,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of Statement given an JSON string - * - * @param jsonString JSON string - * @return An instance of Statement - * @throws IOException if the JSON string is invalid with respect to Statement - */ + /** + * Create an instance of Statement given an JSON string + * + * @param jsonString JSON string + * @return An instance of Statement + * @throws IOException if the JSON string is invalid with respect to Statement + */ public static Statement fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Statement.class); } - /** - * Convert an instance of Statement to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Statement to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java index 685c0cd3d50..74c4258a2eb 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEvent.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * StatsEvent */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StatsEvent { public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class"; @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) @@ -68,63 +66,57 @@ public StatsEvent() { } public StatsEvent propertyClass(String propertyClass) { - this.propertyClass = propertyClass; return this; } - /** + /** * stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\") * @return propertyClass - **/ + */ @javax.annotation.Nonnull public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } public StatsEvent name(String name) { - this.name = name; return this; } - /** + /** * stats event name (e.g. \"put_object\", \"create_repository\", \"<experimental-feature-name>\") * @return name - **/ + */ @javax.annotation.Nonnull public String getName() { return name; } - public void setName(String name) { this.name = name; } public StatsEvent count(Integer count) { - this.count = count; return this; } - /** + /** * number of events of the class and name * @return count - **/ + */ @javax.annotation.Nonnull public Integer getCount() { return count; } - public void setCount(Integer count) { this.count = count; } @@ -236,12 +228,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("count"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StatsEvent - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StatsEvent + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StatsEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -292,7 +284,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -331,22 +328,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StatsEvent given an JSON string - * - * @param jsonString JSON string - * @return An instance of StatsEvent - * @throws IOException if the JSON string is invalid with respect to StatsEvent - */ + /** + * Create an instance of StatsEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatsEvent + * @throws IOException if the JSON string is invalid with respect to StatsEvent + */ public static StatsEvent fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StatsEvent.class); } - /** - * Convert an instance of StatsEvent to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StatsEvent to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java index b978bb1a9ee..1873638f3af 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StatsEventsList.java @@ -40,12 +40,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -53,7 +51,7 @@ /** * StatsEventsList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StatsEventsList { public static final String SERIALIZED_NAME_EVENTS = "events"; @SerializedName(SERIALIZED_NAME_EVENTS) @@ -63,7 +61,6 @@ public StatsEventsList() { } public StatsEventsList events(List events) { - this.events = events; return this; } @@ -76,16 +73,15 @@ public StatsEventsList addEventsItem(StatsEvent eventsItem) { return this; } - /** + /** * Get events * @return events - **/ + */ @javax.annotation.Nonnull public List getEvents() { return events; } - public void setEvents(List events) { this.events = events; } @@ -189,12 +185,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("events"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StatsEventsList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StatsEventsList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StatsEventsList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -249,7 +245,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -288,22 +289,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StatsEventsList given an JSON string - * - * @param jsonString JSON string - * @return An instance of StatsEventsList - * @throws IOException if the JSON string is invalid with respect to StatsEventsList - */ + /** + * Create an instance of StatsEventsList given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatsEventsList + * @throws IOException if the JSON string is invalid with respect to StatsEventsList + */ public static StatsEventsList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StatsEventsList.class); } - /** - * Convert an instance of StatsEventsList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StatsEventsList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java index f4f6759e280..61efe875f8e 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageConfig.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * StorageConfig */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StorageConfig { public static final String SERIALIZED_NAME_BLOCKSTORE_TYPE = "blockstore_type"; @SerializedName(SERIALIZED_NAME_BLOCKSTORE_TYPE) @@ -92,189 +90,171 @@ public StorageConfig() { } public StorageConfig blockstoreType(String blockstoreType) { - this.blockstoreType = blockstoreType; return this; } - /** + /** * Get blockstoreType * @return blockstoreType - **/ + */ @javax.annotation.Nonnull public String getBlockstoreType() { return blockstoreType; } - public void setBlockstoreType(String blockstoreType) { this.blockstoreType = blockstoreType; } public StorageConfig blockstoreNamespaceExample(String blockstoreNamespaceExample) { - this.blockstoreNamespaceExample = blockstoreNamespaceExample; return this; } - /** + /** * Get blockstoreNamespaceExample * @return blockstoreNamespaceExample - **/ + */ @javax.annotation.Nonnull public String getBlockstoreNamespaceExample() { return blockstoreNamespaceExample; } - public void setBlockstoreNamespaceExample(String blockstoreNamespaceExample) { this.blockstoreNamespaceExample = blockstoreNamespaceExample; } public StorageConfig blockstoreNamespaceValidityRegex(String blockstoreNamespaceValidityRegex) { - this.blockstoreNamespaceValidityRegex = blockstoreNamespaceValidityRegex; return this; } - /** + /** * Get blockstoreNamespaceValidityRegex * @return blockstoreNamespaceValidityRegex - **/ + */ @javax.annotation.Nonnull public String getBlockstoreNamespaceValidityRegex() { return blockstoreNamespaceValidityRegex; } - public void setBlockstoreNamespaceValidityRegex(String blockstoreNamespaceValidityRegex) { this.blockstoreNamespaceValidityRegex = blockstoreNamespaceValidityRegex; } public StorageConfig defaultNamespacePrefix(String defaultNamespacePrefix) { - this.defaultNamespacePrefix = defaultNamespacePrefix; return this; } - /** + /** * Get defaultNamespacePrefix * @return defaultNamespacePrefix - **/ + */ @javax.annotation.Nullable public String getDefaultNamespacePrefix() { return defaultNamespacePrefix; } - public void setDefaultNamespacePrefix(String defaultNamespacePrefix) { this.defaultNamespacePrefix = defaultNamespacePrefix; } public StorageConfig preSignSupport(Boolean preSignSupport) { - this.preSignSupport = preSignSupport; return this; } - /** + /** * Get preSignSupport * @return preSignSupport - **/ + */ @javax.annotation.Nonnull public Boolean getPreSignSupport() { return preSignSupport; } - public void setPreSignSupport(Boolean preSignSupport) { this.preSignSupport = preSignSupport; } public StorageConfig preSignSupportUi(Boolean preSignSupportUi) { - this.preSignSupportUi = preSignSupportUi; return this; } - /** + /** * Get preSignSupportUi * @return preSignSupportUi - **/ + */ @javax.annotation.Nonnull public Boolean getPreSignSupportUi() { return preSignSupportUi; } - public void setPreSignSupportUi(Boolean preSignSupportUi) { this.preSignSupportUi = preSignSupportUi; } public StorageConfig importSupport(Boolean importSupport) { - this.importSupport = importSupport; return this; } - /** + /** * Get importSupport * @return importSupport - **/ + */ @javax.annotation.Nonnull public Boolean getImportSupport() { return importSupport; } - public void setImportSupport(Boolean importSupport) { this.importSupport = importSupport; } public StorageConfig importValidityRegex(String importValidityRegex) { - this.importValidityRegex = importValidityRegex; return this; } - /** + /** * Get importValidityRegex * @return importValidityRegex - **/ + */ @javax.annotation.Nonnull public String getImportValidityRegex() { return importValidityRegex; } - public void setImportValidityRegex(String importValidityRegex) { this.importValidityRegex = importValidityRegex; } public StorageConfig preSignMultipartUpload(Boolean preSignMultipartUpload) { - this.preSignMultipartUpload = preSignMultipartUpload; return this; } - /** + /** * Get preSignMultipartUpload * @return preSignMultipartUpload - **/ + */ @javax.annotation.Nullable public Boolean getPreSignMultipartUpload() { return preSignMultipartUpload; } - public void setPreSignMultipartUpload(Boolean preSignMultipartUpload) { this.preSignMultipartUpload = preSignMultipartUpload; } @@ -408,12 +388,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("import_validity_regex"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StorageConfig - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageConfig + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StorageConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -473,7 +453,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -512,22 +497,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StorageConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of StorageConfig - * @throws IOException if the JSON string is invalid with respect to StorageConfig - */ + /** + * Create an instance of StorageConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageConfig + * @throws IOException if the JSON string is invalid with respect to StorageConfig + */ public static StorageConfig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StorageConfig.class); } - /** - * Convert an instance of StorageConfig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StorageConfig to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java index 1d101804f9b..a833630cff6 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StorageURI.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * URI to a path in a storage provider (e.g. \"s3://bucket1/path/to/object\") */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StorageURI { public static final String SERIALIZED_NAME_LOCATION = "location"; @SerializedName(SERIALIZED_NAME_LOCATION) @@ -60,21 +58,19 @@ public StorageURI() { } public StorageURI location(String location) { - this.location = location; return this; } - /** + /** * Get location * @return location - **/ + */ @javax.annotation.Nonnull public String getLocation() { return location; } - public void setLocation(String location) { this.location = location; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("location"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StorageURI - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StorageURI + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StorageURI.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StorageURI given an JSON string - * - * @param jsonString JSON string - * @return An instance of StorageURI - * @throws IOException if the JSON string is invalid with respect to StorageURI - */ + /** + * Create an instance of StorageURI given an JSON string + * + * @param jsonString JSON string + * @return An instance of StorageURI + * @throws IOException if the JSON string is invalid with respect to StorageURI + */ public static StorageURI fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StorageURI.class); } - /** - * Convert an instance of StorageURI to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StorageURI to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StsAuthRequest.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StsAuthRequest.java index b3e67353f7d..41ffe6795d7 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/StsAuthRequest.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/StsAuthRequest.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * StsAuthRequest */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class StsAuthRequest { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) @@ -72,84 +70,76 @@ public StsAuthRequest() { } public StsAuthRequest code(String code) { - this.code = code; return this; } - /** + /** * Get code * @return code - **/ + */ @javax.annotation.Nonnull public String getCode() { return code; } - public void setCode(String code) { this.code = code; } public StsAuthRequest state(String state) { - this.state = state; return this; } - /** + /** * Get state * @return state - **/ + */ @javax.annotation.Nonnull public String getState() { return state; } - public void setState(String state) { this.state = state; } public StsAuthRequest redirectUri(String redirectUri) { - this.redirectUri = redirectUri; return this; } - /** + /** * Get redirectUri * @return redirectUri - **/ + */ @javax.annotation.Nonnull public String getRedirectUri() { return redirectUri; } - public void setRedirectUri(String redirectUri) { this.redirectUri = redirectUri; } public StsAuthRequest ttlSeconds(Long ttlSeconds) { - this.ttlSeconds = ttlSeconds; return this; } - /** + /** * The time-to-live for the generated token in seconds. The default value is 3600 seconds (1 hour) maximum time allowed is 12 hours. * @return ttlSeconds - **/ + */ @javax.annotation.Nullable public Long getTtlSeconds() { return ttlSeconds; } - public void setTtlSeconds(Long ttlSeconds) { this.ttlSeconds = ttlSeconds; } @@ -264,12 +254,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("redirect_uri"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StsAuthRequest - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StsAuthRequest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StsAuthRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -323,7 +313,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -362,22 +357,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of StsAuthRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of StsAuthRequest - * @throws IOException if the JSON string is invalid with respect to StsAuthRequest - */ + /** + * Create an instance of StsAuthRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StsAuthRequest + * @throws IOException if the JSON string is invalid with respect to StsAuthRequest + */ public static StsAuthRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StsAuthRequest.class); } - /** - * Convert an instance of StsAuthRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StsAuthRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java index f57b4b4fd2c..636d7be8a02 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/TagCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * Make tag ID point at this REF. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TagCreation { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -68,63 +66,57 @@ public TagCreation() { } public TagCreation id(String id) { - this.id = id; return this; } - /** + /** * ID of tag to create * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public TagCreation ref(String ref) { - this.ref = ref; return this; } - /** + /** * the commit to tag * @return ref - **/ + */ @javax.annotation.Nonnull public String getRef() { return ref; } - public void setRef(String ref) { this.ref = ref; } public TagCreation force(Boolean force) { - this.force = force; return this; } - /** + /** * Get force * @return force - **/ + */ @javax.annotation.Nullable public Boolean getForce() { return force; } - public void setForce(Boolean force) { this.force = force; } @@ -235,12 +227,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ref"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TagCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TagCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TagCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -291,7 +283,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -330,22 +327,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of TagCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of TagCreation - * @throws IOException if the JSON string is invalid with respect to TagCreation - */ + /** + * Create an instance of TagCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of TagCreation + * @throws IOException if the JSON string is invalid with respect to TagCreation + */ public static TagCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TagCreation.class); } - /** - * Convert an instance of TagCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TagCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/TaskInfo.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/TaskInfo.java index 4c5dbd6eabe..9a3f211183a 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/TaskInfo.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/TaskInfo.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * TaskInfo */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class TaskInfo { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -60,21 +58,19 @@ public TaskInfo() { } public TaskInfo id(String id) { - this.id = id; return this; } - /** + /** * ID of the task * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to TaskInfo - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to TaskInfo + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!TaskInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of TaskInfo given an JSON string - * - * @param jsonString JSON string - * @return An instance of TaskInfo - * @throws IOException if the JSON string is invalid with respect to TaskInfo - */ + /** + * Create an instance of TaskInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of TaskInfo + * @throws IOException if the JSON string is invalid with respect to TaskInfo + */ public static TaskInfo fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, TaskInfo.class); } - /** - * Convert an instance of TaskInfo to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of TaskInfo to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java index e5b82e4187d..8728bcb6844 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UnderlyingObjectProperties.java @@ -38,12 +38,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -51,7 +49,7 @@ /** * UnderlyingObjectProperties */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UnderlyingObjectProperties { public static final String SERIALIZED_NAME_STORAGE_CLASS = "storage_class"; @SerializedName(SERIALIZED_NAME_STORAGE_CLASS) @@ -61,21 +59,19 @@ public UnderlyingObjectProperties() { } public UnderlyingObjectProperties storageClass(String storageClass) { - this.storageClass = storageClass; return this; } - /** + /** * Get storageClass * @return storageClass - **/ + */ @javax.annotation.Nullable public String getStorageClass() { return storageClass; } - public void setStorageClass(String storageClass) { this.storageClass = storageClass; } @@ -189,12 +185,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UnderlyingObjectProperties - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UnderlyingObjectProperties + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UnderlyingObjectProperties.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -235,7 +231,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -274,22 +275,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of UnderlyingObjectProperties given an JSON string - * - * @param jsonString JSON string - * @return An instance of UnderlyingObjectProperties - * @throws IOException if the JSON string is invalid with respect to UnderlyingObjectProperties - */ + /** + * Create an instance of UnderlyingObjectProperties given an JSON string + * + * @param jsonString JSON string + * @return An instance of UnderlyingObjectProperties + * @throws IOException if the JSON string is invalid with respect to UnderlyingObjectProperties + */ public static UnderlyingObjectProperties fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UnderlyingObjectProperties.class); } - /** - * Convert an instance of UnderlyingObjectProperties to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UnderlyingObjectProperties to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java index 3db28254226..6b1be19d2ba 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UpdateToken.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * UpdateToken */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UpdateToken { public static final String SERIALIZED_NAME_STAGING_TOKEN = "staging_token"; @SerializedName(SERIALIZED_NAME_STAGING_TOKEN) @@ -60,21 +58,19 @@ public UpdateToken() { } public UpdateToken stagingToken(String stagingToken) { - this.stagingToken = stagingToken; return this; } - /** + /** * Get stagingToken * @return stagingToken - **/ + */ @javax.annotation.Nonnull public String getStagingToken() { return stagingToken; } - public void setStagingToken(String stagingToken) { this.stagingToken = stagingToken; } @@ -178,12 +174,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("staging_token"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UpdateToken - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateToken + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UpdateToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -231,7 +227,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -270,22 +271,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of UpdateToken given an JSON string - * - * @param jsonString JSON string - * @return An instance of UpdateToken - * @throws IOException if the JSON string is invalid with respect to UpdateToken - */ + /** + * Create an instance of UpdateToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateToken + * @throws IOException if the JSON string is invalid with respect to UpdateToken + */ public static UpdateToken fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UpdateToken.class); } - /** - * Convert an instance of UpdateToken to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UpdateToken to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UploadPart.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UploadPart.java index 8382c91e869..b71c494e661 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UploadPart.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UploadPart.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * UploadPart */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UploadPart { public static final String SERIALIZED_NAME_PART_NUMBER = "part_number"; @SerializedName(SERIALIZED_NAME_PART_NUMBER) @@ -64,42 +62,38 @@ public UploadPart() { } public UploadPart partNumber(Integer partNumber) { - this.partNumber = partNumber; return this; } - /** + /** * Get partNumber * @return partNumber - **/ + */ @javax.annotation.Nonnull public Integer getPartNumber() { return partNumber; } - public void setPartNumber(Integer partNumber) { this.partNumber = partNumber; } public UploadPart etag(String etag) { - this.etag = etag; return this; } - /** + /** * Get etag * @return etag - **/ + */ @javax.annotation.Nonnull public String getEtag() { return etag; } - public void setEtag(String etag) { this.etag = etag; } @@ -207,12 +201,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("etag"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UploadPart - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UploadPart + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UploadPart.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -260,7 +254,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -299,22 +298,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of UploadPart given an JSON string - * - * @param jsonString JSON string - * @return An instance of UploadPart - * @throws IOException if the JSON string is invalid with respect to UploadPart - */ + /** + * Create an instance of UploadPart given an JSON string + * + * @param jsonString JSON string + * @return An instance of UploadPart + * @throws IOException if the JSON string is invalid with respect to UploadPart + */ public static UploadPart fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UploadPart.class); } - /** - * Convert an instance of UploadPart to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UploadPart to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UsageReport.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UsageReport.java index 3ff52e24d0d..850caf4e4cc 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UsageReport.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UsageReport.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * UsageReport */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UsageReport { public static final String SERIALIZED_NAME_YEAR = "year"; @SerializedName(SERIALIZED_NAME_YEAR) @@ -68,63 +66,57 @@ public UsageReport() { } public UsageReport year(Integer year) { - this.year = year; return this; } - /** + /** * Get year * @return year - **/ + */ @javax.annotation.Nonnull public Integer getYear() { return year; } - public void setYear(Integer year) { this.year = year; } public UsageReport month(Integer month) { - this.month = month; return this; } - /** + /** * Get month * @return month - **/ + */ @javax.annotation.Nonnull public Integer getMonth() { return month; } - public void setMonth(Integer month) { this.month = month; } public UsageReport count(Long count) { - this.count = count; return this; } - /** + /** * Get count * @return count - **/ + */ @javax.annotation.Nonnull public Long getCount() { return count; } - public void setCount(Long count) { this.count = count; } @@ -236,12 +228,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("count"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UsageReport - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UsageReport + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UsageReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -286,7 +278,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -325,22 +322,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of UsageReport given an JSON string - * - * @param jsonString JSON string - * @return An instance of UsageReport - * @throws IOException if the JSON string is invalid with respect to UsageReport - */ + /** + * Create an instance of UsageReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of UsageReport + * @throws IOException if the JSON string is invalid with respect to UsageReport + */ public static UsageReport fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UsageReport.class); } - /** - * Convert an instance of UsageReport to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UsageReport to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java index 7aab632b873..1c5bf20416a 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/User.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * User */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class User { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -72,84 +70,76 @@ public User() { } public User id(String id) { - this.id = id; return this; } - /** + /** * A unique identifier for the user. Cannot be edited. * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public User creationDate(Long creationDate) { - this.creationDate = creationDate; return this; } - /** + /** * Unix Epoch in seconds * @return creationDate - **/ + */ @javax.annotation.Nonnull public Long getCreationDate() { return creationDate; } - public void setCreationDate(Long creationDate) { this.creationDate = creationDate; } public User friendlyName(String friendlyName) { - this.friendlyName = friendlyName; return this; } - /** + /** * A shorter name for the user than the id. Unlike id it does not identify the user (it might not be unique). Used in some places in the UI. * @return friendlyName - **/ + */ @javax.annotation.Nullable public String getFriendlyName() { return friendlyName; } - public void setFriendlyName(String friendlyName) { this.friendlyName = friendlyName; } public User email(String email) { - this.email = email; return this; } - /** + /** * The email address of the user. If API authentication is enabled, this field is mandatory and will be invited to login. If API authentication is disabled, this field will be ignored. All current APIAuthenticators require the email to be lowercase and unique, although custom authenticators may not enforce this. * @return email - **/ + */ @javax.annotation.Nullable public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } @@ -263,12 +253,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("creation_date"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to User - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to User + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!User.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -322,7 +312,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -361,22 +356,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of User given an JSON string - * - * @param jsonString JSON string - * @return An instance of User - * @throws IOException if the JSON string is invalid with respect to User - */ + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ public static User fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, User.class); } - /** - * Convert an instance of User to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java index 020153e0853..466cdcf47c5 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserCreation.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * UserCreation */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UserCreation { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -64,42 +62,38 @@ public UserCreation() { } public UserCreation id(String id) { - this.id = id; return this; } - /** + /** * a unique identifier for the user. * @return id - **/ + */ @javax.annotation.Nonnull public String getId() { return id; } - public void setId(String id) { this.id = id; } public UserCreation inviteUser(Boolean inviteUser) { - this.inviteUser = inviteUser; return this; } - /** + /** * Get inviteUser * @return inviteUser - **/ + */ @javax.annotation.Nullable public Boolean getInviteUser() { return inviteUser; } - public void setInviteUser(Boolean inviteUser) { this.inviteUser = inviteUser; } @@ -206,12 +200,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserCreation - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserCreation + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UserCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -259,7 +253,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -298,22 +297,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of UserCreation given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserCreation - * @throws IOException if the JSON string is invalid with respect to UserCreation - */ + /** + * Create an instance of UserCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserCreation + * @throws IOException if the JSON string is invalid with respect to UserCreation + */ public static UserCreation fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UserCreation.class); } - /** - * Convert an instance of UserCreation to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UserCreation to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java index 80da475391f..9ddea7ea252 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/UserList.java @@ -41,12 +41,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -54,7 +52,7 @@ /** * UserList */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class UserList { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) @@ -68,28 +66,25 @@ public UserList() { } public UserList pagination(Pagination pagination) { - this.pagination = pagination; return this; } - /** + /** * Get pagination * @return pagination - **/ + */ @javax.annotation.Nonnull public Pagination getPagination() { return pagination; } - public void setPagination(Pagination pagination) { this.pagination = pagination; } public UserList results(List results) { - this.results = results; return this; } @@ -102,16 +97,15 @@ public UserList addResultsItem(User resultsItem) { return this; } - /** + /** * Get results * @return results - **/ + */ @javax.annotation.Nonnull public List getResults() { return results; } - public void setResults(List results) { this.results = results; } @@ -219,12 +213,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("results"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to UserList - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UserList + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!UserList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -281,7 +275,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -320,22 +319,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of UserList given an JSON string - * - * @param jsonString JSON string - * @return An instance of UserList - * @throws IOException if the JSON string is invalid with respect to UserList - */ + /** + * Create an instance of UserList given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserList + * @throws IOException if the JSON string is invalid with respect to UserList + */ public static UserList fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, UserList.class); } - /** - * Convert an instance of UserList to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of UserList to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java b/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java index fd13ebd0005..c78f3696f4c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java +++ b/clients/java/src/main/java/io/lakefs/clients/sdk/model/VersionConfig.java @@ -37,12 +37,10 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; -import java.lang.reflect.Type; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import io.lakefs.clients.sdk.JSON; @@ -50,7 +48,7 @@ /** * VersionConfig */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0") public class VersionConfig { public static final String SERIALIZED_NAME_VERSION = "version"; @SerializedName(SERIALIZED_NAME_VERSION) @@ -72,84 +70,76 @@ public VersionConfig() { } public VersionConfig version(String version) { - this.version = version; return this; } - /** + /** * Get version * @return version - **/ + */ @javax.annotation.Nullable public String getVersion() { return version; } - public void setVersion(String version) { this.version = version; } public VersionConfig latestVersion(String latestVersion) { - this.latestVersion = latestVersion; return this; } - /** + /** * Get latestVersion * @return latestVersion - **/ + */ @javax.annotation.Nullable public String getLatestVersion() { return latestVersion; } - public void setLatestVersion(String latestVersion) { this.latestVersion = latestVersion; } public VersionConfig upgradeRecommended(Boolean upgradeRecommended) { - this.upgradeRecommended = upgradeRecommended; return this; } - /** + /** * Get upgradeRecommended * @return upgradeRecommended - **/ + */ @javax.annotation.Nullable public Boolean getUpgradeRecommended() { return upgradeRecommended; } - public void setUpgradeRecommended(Boolean upgradeRecommended) { this.upgradeRecommended = upgradeRecommended; } public VersionConfig upgradeUrl(String upgradeUrl) { - this.upgradeUrl = upgradeUrl; return this; } - /** + /** * Get upgradeUrl * @return upgradeUrl - **/ + */ @javax.annotation.Nullable public String getUpgradeUrl() { return upgradeUrl; } - public void setUpgradeUrl(String upgradeUrl) { this.upgradeUrl = upgradeUrl; } @@ -261,12 +251,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to VersionConfig - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to VersionConfig + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!VersionConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -313,7 +303,12 @@ else if (entry.getValue() instanceof Boolean) else if (entry.getValue() instanceof Character) obj.addProperty(entry.getKey(), (Character) entry.getValue()); else { - obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } } } } @@ -352,22 +347,22 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean()) } } - /** - * Create an instance of VersionConfig given an JSON string - * - * @param jsonString JSON string - * @return An instance of VersionConfig - * @throws IOException if the JSON string is invalid with respect to VersionConfig - */ + /** + * Create an instance of VersionConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of VersionConfig + * @throws IOException if the JSON string is invalid with respect to VersionConfig + */ public static VersionConfig fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, VersionConfig.class); } - /** - * Convert an instance of VersionConfig to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of VersionConfig to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/clients/python/.openapi-generator/VERSION b/clients/python/.openapi-generator/VERSION index 4122521804f..09a6d30847d 100644 --- a/clients/python/.openapi-generator/VERSION +++ b/clients/python/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.0 \ No newline at end of file +7.8.0 diff --git a/clients/python/README.md b/clients/python/README.md index dc2898428d2..a3720edb61e 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -5,6 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0 - Package version: 0.1.0-SNAPSHOT +- Generator version: 7.8.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -50,7 +51,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint diff --git a/clients/python/docs/ACL.md b/clients/python/docs/ACL.md index 1671ce8c8d6..62b13cda640 100644 --- a/clients/python/docs/ACL.md +++ b/clients/python/docs/ACL.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of ACL from a JSON string acl_instance = ACL.from_json(json) # print the JSON string representation of the object -print ACL.to_json() +print(ACL.to_json()) # convert the object into a dict acl_dict = acl_instance.to_dict() # create an instance of ACL from a dict -acl_form_dict = acl.from_dict(acl_dict) +acl_from_dict = ACL.from_dict(acl_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/AbortPresignMultipartUpload.md b/clients/python/docs/AbortPresignMultipartUpload.md index 63abf1efd37..cf87ed47203 100644 --- a/clients/python/docs/AbortPresignMultipartUpload.md +++ b/clients/python/docs/AbortPresignMultipartUpload.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of AbortPresignMultipartUpload from a JSON string abort_presign_multipart_upload_instance = AbortPresignMultipartUpload.from_json(json) # print the JSON string representation of the object -print AbortPresignMultipartUpload.to_json() +print(AbortPresignMultipartUpload.to_json()) # convert the object into a dict abort_presign_multipart_upload_dict = abort_presign_multipart_upload_instance.to_dict() # create an instance of AbortPresignMultipartUpload from a dict -abort_presign_multipart_upload_form_dict = abort_presign_multipart_upload.from_dict(abort_presign_multipart_upload_dict) +abort_presign_multipart_upload_from_dict = AbortPresignMultipartUpload.from_dict(abort_presign_multipart_upload_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/AccessKeyCredentials.md b/clients/python/docs/AccessKeyCredentials.md index 94564e9397d..22d70c603f2 100644 --- a/clients/python/docs/AccessKeyCredentials.md +++ b/clients/python/docs/AccessKeyCredentials.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of AccessKeyCredentials from a JSON string access_key_credentials_instance = AccessKeyCredentials.from_json(json) # print the JSON string representation of the object -print AccessKeyCredentials.to_json() +print(AccessKeyCredentials.to_json()) # convert the object into a dict access_key_credentials_dict = access_key_credentials_instance.to_dict() # create an instance of AccessKeyCredentials from a dict -access_key_credentials_form_dict = access_key_credentials.from_dict(access_key_credentials_dict) +access_key_credentials_from_dict = AccessKeyCredentials.from_dict(access_key_credentials_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ActionRun.md b/clients/python/docs/ActionRun.md index d7cee7f5397..ea540ed7498 100644 --- a/clients/python/docs/ActionRun.md +++ b/clients/python/docs/ActionRun.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of ActionRun from a JSON string action_run_instance = ActionRun.from_json(json) # print the JSON string representation of the object -print ActionRun.to_json() +print(ActionRun.to_json()) # convert the object into a dict action_run_dict = action_run_instance.to_dict() # create an instance of ActionRun from a dict -action_run_form_dict = action_run.from_dict(action_run_dict) +action_run_from_dict = ActionRun.from_dict(action_run_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ActionRunList.md b/clients/python/docs/ActionRunList.md index af87f91cd45..813c398b60d 100644 --- a/clients/python/docs/ActionRunList.md +++ b/clients/python/docs/ActionRunList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of ActionRunList from a JSON string action_run_list_instance = ActionRunList.from_json(json) # print the JSON string representation of the object -print ActionRunList.to_json() +print(ActionRunList.to_json()) # convert the object into a dict action_run_list_dict = action_run_list_instance.to_dict() # create an instance of ActionRunList from a dict -action_run_list_form_dict = action_run_list.from_dict(action_run_list_dict) +action_run_list_from_dict = ActionRunList.from_dict(action_run_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ActionsApi.md b/clients/python/docs/ActionsApi.md index a35752995f8..3f1620b521c 100644 --- a/clients/python/docs/ActionsApi.md +++ b/clients/python/docs/ActionsApi.md @@ -24,8 +24,6 @@ get a run * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.action_run import ActionRun from lakefs_sdk.rest import ApiException @@ -136,8 +134,6 @@ get run hook output * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -249,8 +245,6 @@ list runs * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.action_run_list import ActionRunList from lakefs_sdk.rest import ApiException @@ -367,8 +361,6 @@ list run hooks * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.hook_run_list import HookRunList from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/AuthApi.md b/clients/python/docs/AuthApi.md index dfd5f7b2a63..9f0c415a22a 100644 --- a/clients/python/docs/AuthApi.md +++ b/clients/python/docs/AuthApi.md @@ -56,8 +56,6 @@ add group membership * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -165,8 +163,6 @@ attach policy to group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -274,8 +270,6 @@ attach policy to user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -383,8 +377,6 @@ create credentials * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.credentials_with_secret import CredentialsWithSecret from lakefs_sdk.rest import ApiException @@ -493,8 +485,6 @@ create group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.group import Group from lakefs_sdk.models.group_creation import GroupCreation @@ -604,8 +594,6 @@ create policy * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.policy import Policy from lakefs_sdk.rest import ApiException @@ -715,8 +703,6 @@ create user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.user import User from lakefs_sdk.models.user_creation import UserCreation @@ -827,8 +813,6 @@ attach external principal to user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation from lakefs_sdk.rest import ApiException @@ -940,8 +924,6 @@ delete credentials * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1049,8 +1031,6 @@ delete group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1156,8 +1136,6 @@ delete group membership * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1265,8 +1243,6 @@ delete policy * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1372,8 +1348,6 @@ delete user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1479,8 +1453,6 @@ delete external principal from user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1588,8 +1560,6 @@ detach policy from group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1697,8 +1667,6 @@ detach policy from user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1801,8 +1769,6 @@ perform a login using an external authenticator ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.external_login_information import ExternalLoginInformation @@ -1881,8 +1847,6 @@ get credentials * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.credentials import Credentials from lakefs_sdk.rest import ApiException @@ -1993,8 +1957,6 @@ get current user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.current_user import CurrentUser from lakefs_sdk.rest import ApiException @@ -2095,8 +2057,6 @@ describe external principal by id * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.rest import ApiException @@ -2205,8 +2165,6 @@ get group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.group import Group from lakefs_sdk.rest import ApiException @@ -2315,8 +2273,6 @@ get ACL of group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.acl import ACL from lakefs_sdk.rest import ApiException @@ -2425,8 +2381,6 @@ get policy * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.policy import Policy from lakefs_sdk.rest import ApiException @@ -2535,8 +2489,6 @@ get user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.user import User from lakefs_sdk.rest import ApiException @@ -2645,8 +2597,6 @@ list group members * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.user_list import UserList from lakefs_sdk.rest import ApiException @@ -2760,8 +2710,6 @@ list group policies * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.policy_list import PolicyList from lakefs_sdk.rest import ApiException @@ -2876,8 +2824,6 @@ list groups * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.group_list import GroupList from lakefs_sdk.rest import ApiException @@ -2989,8 +2935,6 @@ list policies * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.policy_list import PolicyList from lakefs_sdk.rest import ApiException @@ -3102,8 +3046,6 @@ list user credentials * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.credentials_list import CredentialsList from lakefs_sdk.rest import ApiException @@ -3218,8 +3160,6 @@ list user external policies attached to a user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal_list import ExternalPrincipalList from lakefs_sdk.rest import ApiException @@ -3334,8 +3274,6 @@ list user groups * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.group_list import GroupList from lakefs_sdk.rest import ApiException @@ -3450,8 +3388,6 @@ list user policies * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.policy_list import PolicyList from lakefs_sdk.rest import ApiException @@ -3568,8 +3504,6 @@ list users * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.user_list import UserList from lakefs_sdk.rest import ApiException @@ -3676,8 +3610,6 @@ perform a login ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.login_information import LoginInformation @@ -3753,8 +3685,6 @@ set ACL of group * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.acl import ACL from lakefs_sdk.rest import ApiException @@ -3863,8 +3793,6 @@ update policy * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.policy import Policy from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/AuthCapabilities.md b/clients/python/docs/AuthCapabilities.md index 83891c271e3..4dea10e9758 100644 --- a/clients/python/docs/AuthCapabilities.md +++ b/clients/python/docs/AuthCapabilities.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of AuthCapabilities from a JSON string auth_capabilities_instance = AuthCapabilities.from_json(json) # print the JSON string representation of the object -print AuthCapabilities.to_json() +print(AuthCapabilities.to_json()) # convert the object into a dict auth_capabilities_dict = auth_capabilities_instance.to_dict() # create an instance of AuthCapabilities from a dict -auth_capabilities_form_dict = auth_capabilities.from_dict(auth_capabilities_dict) +auth_capabilities_from_dict = AuthCapabilities.from_dict(auth_capabilities_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/AuthenticationToken.md b/clients/python/docs/AuthenticationToken.md index 4cf4feb8869..01c159e44be 100644 --- a/clients/python/docs/AuthenticationToken.md +++ b/clients/python/docs/AuthenticationToken.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of AuthenticationToken from a JSON string authentication_token_instance = AuthenticationToken.from_json(json) # print the JSON string representation of the object -print AuthenticationToken.to_json() +print(AuthenticationToken.to_json()) # convert the object into a dict authentication_token_dict = authentication_token_instance.to_dict() # create an instance of AuthenticationToken from a dict -authentication_token_form_dict = authentication_token.from_dict(authentication_token_dict) +authentication_token_from_dict = AuthenticationToken.from_dict(authentication_token_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/BranchCreation.md b/clients/python/docs/BranchCreation.md index fc2c6620e9e..ceb9d39d454 100644 --- a/clients/python/docs/BranchCreation.md +++ b/clients/python/docs/BranchCreation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of BranchCreation from a JSON string branch_creation_instance = BranchCreation.from_json(json) # print the JSON string representation of the object -print BranchCreation.to_json() +print(BranchCreation.to_json()) # convert the object into a dict branch_creation_dict = branch_creation_instance.to_dict() # create an instance of BranchCreation from a dict -branch_creation_form_dict = branch_creation.from_dict(branch_creation_dict) +branch_creation_from_dict = BranchCreation.from_dict(branch_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/BranchProtectionRule.md b/clients/python/docs/BranchProtectionRule.md index b3bcf60667c..c18d502abe6 100644 --- a/clients/python/docs/BranchProtectionRule.md +++ b/clients/python/docs/BranchProtectionRule.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of BranchProtectionRule from a JSON string branch_protection_rule_instance = BranchProtectionRule.from_json(json) # print the JSON string representation of the object -print BranchProtectionRule.to_json() +print(BranchProtectionRule.to_json()) # convert the object into a dict branch_protection_rule_dict = branch_protection_rule_instance.to_dict() # create an instance of BranchProtectionRule from a dict -branch_protection_rule_form_dict = branch_protection_rule.from_dict(branch_protection_rule_dict) +branch_protection_rule_from_dict = BranchProtectionRule.from_dict(branch_protection_rule_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/BranchesApi.md b/clients/python/docs/BranchesApi.md index 33c09474b8f..fd7915a3101 100644 --- a/clients/python/docs/BranchesApi.md +++ b/clients/python/docs/BranchesApi.md @@ -28,8 +28,6 @@ Replay the changes from the given commit on the branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.cherry_pick_creation import CherryPickCreation from lakefs_sdk.models.commit import Commit @@ -146,8 +144,6 @@ create branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.branch_creation import BranchCreation from lakefs_sdk.rest import ApiException @@ -261,8 +257,6 @@ delete branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -373,8 +367,6 @@ diff branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.diff_list import DiffList from lakefs_sdk.rest import ApiException @@ -493,8 +485,6 @@ get branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.ref import Ref from lakefs_sdk.rest import ApiException @@ -605,8 +595,6 @@ list branches * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.ref_list import RefList from lakefs_sdk.rest import ApiException @@ -721,8 +709,6 @@ reset branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.reset_creation import ResetCreation from lakefs_sdk.rest import ApiException @@ -835,8 +821,6 @@ revert * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.revert_creation import RevertCreation from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/CherryPickCreation.md b/clients/python/docs/CherryPickCreation.md index 9dd55180d30..7432cf0a958 100644 --- a/clients/python/docs/CherryPickCreation.md +++ b/clients/python/docs/CherryPickCreation.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of CherryPickCreation from a JSON string cherry_pick_creation_instance = CherryPickCreation.from_json(json) # print the JSON string representation of the object -print CherryPickCreation.to_json() +print(CherryPickCreation.to_json()) # convert the object into a dict cherry_pick_creation_dict = cherry_pick_creation_instance.to_dict() # create an instance of CherryPickCreation from a dict -cherry_pick_creation_form_dict = cherry_pick_creation.from_dict(cherry_pick_creation_dict) +cherry_pick_creation_from_dict = CherryPickCreation.from_dict(cherry_pick_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CommPrefsInput.md b/clients/python/docs/CommPrefsInput.md index d38c30b04e2..4ce9f258b81 100644 --- a/clients/python/docs/CommPrefsInput.md +++ b/clients/python/docs/CommPrefsInput.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of CommPrefsInput from a JSON string comm_prefs_input_instance = CommPrefsInput.from_json(json) # print the JSON string representation of the object -print CommPrefsInput.to_json() +print(CommPrefsInput.to_json()) # convert the object into a dict comm_prefs_input_dict = comm_prefs_input_instance.to_dict() # create an instance of CommPrefsInput from a dict -comm_prefs_input_form_dict = comm_prefs_input.from_dict(comm_prefs_input_dict) +comm_prefs_input_from_dict = CommPrefsInput.from_dict(comm_prefs_input_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Commit.md b/clients/python/docs/Commit.md index 2ded7119235..1e4b3654eb1 100644 --- a/clients/python/docs/Commit.md +++ b/clients/python/docs/Commit.md @@ -25,12 +25,12 @@ json = "{}" # create an instance of Commit from a JSON string commit_instance = Commit.from_json(json) # print the JSON string representation of the object -print Commit.to_json() +print(Commit.to_json()) # convert the object into a dict commit_dict = commit_instance.to_dict() # create an instance of Commit from a dict -commit_form_dict = commit.from_dict(commit_dict) +commit_from_dict = Commit.from_dict(commit_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CommitCreation.md b/clients/python/docs/CommitCreation.md index 1c8ef0bebaa..5706dd3944a 100644 --- a/clients/python/docs/CommitCreation.md +++ b/clients/python/docs/CommitCreation.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of CommitCreation from a JSON string commit_creation_instance = CommitCreation.from_json(json) # print the JSON string representation of the object -print CommitCreation.to_json() +print(CommitCreation.to_json()) # convert the object into a dict commit_creation_dict = commit_creation_instance.to_dict() # create an instance of CommitCreation from a dict -commit_creation_form_dict = commit_creation.from_dict(commit_creation_dict) +commit_creation_from_dict = CommitCreation.from_dict(commit_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CommitList.md b/clients/python/docs/CommitList.md index 65f04ad2b9a..fe1ad9b423c 100644 --- a/clients/python/docs/CommitList.md +++ b/clients/python/docs/CommitList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of CommitList from a JSON string commit_list_instance = CommitList.from_json(json) # print the JSON string representation of the object -print CommitList.to_json() +print(CommitList.to_json()) # convert the object into a dict commit_list_dict = commit_list_instance.to_dict() # create an instance of CommitList from a dict -commit_list_form_dict = commit_list.from_dict(commit_list_dict) +commit_list_from_dict = CommitList.from_dict(commit_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CommitOverrides.md b/clients/python/docs/CommitOverrides.md index f6c3d39fce6..b51c56a5413 100644 --- a/clients/python/docs/CommitOverrides.md +++ b/clients/python/docs/CommitOverrides.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of CommitOverrides from a JSON string commit_overrides_instance = CommitOverrides.from_json(json) # print the JSON string representation of the object -print CommitOverrides.to_json() +print(CommitOverrides.to_json()) # convert the object into a dict commit_overrides_dict = commit_overrides_instance.to_dict() # create an instance of CommitOverrides from a dict -commit_overrides_form_dict = commit_overrides.from_dict(commit_overrides_dict) +commit_overrides_from_dict = CommitOverrides.from_dict(commit_overrides_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CommitRecordCreation.md b/clients/python/docs/CommitRecordCreation.md index 9cd0ae1890f..59fe0615655 100644 --- a/clients/python/docs/CommitRecordCreation.md +++ b/clients/python/docs/CommitRecordCreation.md @@ -26,12 +26,12 @@ json = "{}" # create an instance of CommitRecordCreation from a JSON string commit_record_creation_instance = CommitRecordCreation.from_json(json) # print the JSON string representation of the object -print CommitRecordCreation.to_json() +print(CommitRecordCreation.to_json()) # convert the object into a dict commit_record_creation_dict = commit_record_creation_instance.to_dict() # create an instance of CommitRecordCreation from a dict -commit_record_creation_form_dict = commit_record_creation.from_dict(commit_record_creation_dict) +commit_record_creation_from_dict = CommitRecordCreation.from_dict(commit_record_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CommitsApi.md b/clients/python/docs/CommitsApi.md index 067f4bdaf84..baed5ad2f85 100644 --- a/clients/python/docs/CommitsApi.md +++ b/clients/python/docs/CommitsApi.md @@ -22,8 +22,6 @@ create commit * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.commit import Commit from lakefs_sdk.models.commit_creation import CommitCreation @@ -143,8 +141,6 @@ get commit * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.commit import Commit from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/CompletePresignMultipartUpload.md b/clients/python/docs/CompletePresignMultipartUpload.md index ed94ebfa770..8c46328a6ae 100644 --- a/clients/python/docs/CompletePresignMultipartUpload.md +++ b/clients/python/docs/CompletePresignMultipartUpload.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of CompletePresignMultipartUpload from a JSON string complete_presign_multipart_upload_instance = CompletePresignMultipartUpload.from_json(json) # print the JSON string representation of the object -print CompletePresignMultipartUpload.to_json() +print(CompletePresignMultipartUpload.to_json()) # convert the object into a dict complete_presign_multipart_upload_dict = complete_presign_multipart_upload_instance.to_dict() # create an instance of CompletePresignMultipartUpload from a dict -complete_presign_multipart_upload_form_dict = complete_presign_multipart_upload.from_dict(complete_presign_multipart_upload_dict) +complete_presign_multipart_upload_from_dict = CompletePresignMultipartUpload.from_dict(complete_presign_multipart_upload_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Config.md b/clients/python/docs/Config.md index a082349a18b..91fe3ea95f6 100644 --- a/clients/python/docs/Config.md +++ b/clients/python/docs/Config.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of Config from a JSON string config_instance = Config.from_json(json) # print the JSON string representation of the object -print Config.to_json() +print(Config.to_json()) # convert the object into a dict config_dict = config_instance.to_dict() # create an instance of Config from a dict -config_form_dict = config.from_dict(config_dict) +config_from_dict = Config.from_dict(config_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ConfigApi.md b/clients/python/docs/ConfigApi.md index bb153b51290..ef57157c866 100644 --- a/clients/python/docs/ConfigApi.md +++ b/clients/python/docs/ConfigApi.md @@ -23,8 +23,6 @@ retrieve lakeFS configuration * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.config import Config from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/Credentials.md b/clients/python/docs/Credentials.md index 28c7dde97ae..6851d6bc432 100644 --- a/clients/python/docs/Credentials.md +++ b/clients/python/docs/Credentials.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of Credentials from a JSON string credentials_instance = Credentials.from_json(json) # print the JSON string representation of the object -print Credentials.to_json() +print(Credentials.to_json()) # convert the object into a dict credentials_dict = credentials_instance.to_dict() # create an instance of Credentials from a dict -credentials_form_dict = credentials.from_dict(credentials_dict) +credentials_from_dict = Credentials.from_dict(credentials_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CredentialsList.md b/clients/python/docs/CredentialsList.md index f0b8eb7e035..7034374fde6 100644 --- a/clients/python/docs/CredentialsList.md +++ b/clients/python/docs/CredentialsList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of CredentialsList from a JSON string credentials_list_instance = CredentialsList.from_json(json) # print the JSON string representation of the object -print CredentialsList.to_json() +print(CredentialsList.to_json()) # convert the object into a dict credentials_list_dict = credentials_list_instance.to_dict() # create an instance of CredentialsList from a dict -credentials_list_form_dict = credentials_list.from_dict(credentials_list_dict) +credentials_list_from_dict = CredentialsList.from_dict(credentials_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CredentialsWithSecret.md b/clients/python/docs/CredentialsWithSecret.md index 045757b7993..60034bb2431 100644 --- a/clients/python/docs/CredentialsWithSecret.md +++ b/clients/python/docs/CredentialsWithSecret.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of CredentialsWithSecret from a JSON string credentials_with_secret_instance = CredentialsWithSecret.from_json(json) # print the JSON string representation of the object -print CredentialsWithSecret.to_json() +print(CredentialsWithSecret.to_json()) # convert the object into a dict credentials_with_secret_dict = credentials_with_secret_instance.to_dict() # create an instance of CredentialsWithSecret from a dict -credentials_with_secret_form_dict = credentials_with_secret.from_dict(credentials_with_secret_dict) +credentials_with_secret_from_dict = CredentialsWithSecret.from_dict(credentials_with_secret_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/CurrentUser.md b/clients/python/docs/CurrentUser.md index b64cd254335..355255468f2 100644 --- a/clients/python/docs/CurrentUser.md +++ b/clients/python/docs/CurrentUser.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of CurrentUser from a JSON string current_user_instance = CurrentUser.from_json(json) # print the JSON string representation of the object -print CurrentUser.to_json() +print(CurrentUser.to_json()) # convert the object into a dict current_user_dict = current_user_instance.to_dict() # create an instance of CurrentUser from a dict -current_user_form_dict = current_user.from_dict(current_user_dict) +current_user_from_dict = CurrentUser.from_dict(current_user_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Diff.md b/clients/python/docs/Diff.md index 17ac92c081c..3810a9fd5db 100644 --- a/clients/python/docs/Diff.md +++ b/clients/python/docs/Diff.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of Diff from a JSON string diff_instance = Diff.from_json(json) # print the JSON string representation of the object -print Diff.to_json() +print(Diff.to_json()) # convert the object into a dict diff_dict = diff_instance.to_dict() # create an instance of Diff from a dict -diff_form_dict = diff.from_dict(diff_dict) +diff_from_dict = Diff.from_dict(diff_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/DiffList.md b/clients/python/docs/DiffList.md index a7856117662..28927ee582e 100644 --- a/clients/python/docs/DiffList.md +++ b/clients/python/docs/DiffList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of DiffList from a JSON string diff_list_instance = DiffList.from_json(json) # print the JSON string representation of the object -print DiffList.to_json() +print(DiffList.to_json()) # convert the object into a dict diff_list_dict = diff_list_instance.to_dict() # create an instance of DiffList from a dict -diff_list_form_dict = diff_list.from_dict(diff_list_dict) +diff_list_from_dict = DiffList.from_dict(diff_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Error.md b/clients/python/docs/Error.md index b0e5ae57a7b..290b326204a 100644 --- a/clients/python/docs/Error.md +++ b/clients/python/docs/Error.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of Error from a JSON string error_instance = Error.from_json(json) # print the JSON string representation of the object -print Error.to_json() +print(Error.to_json()) # convert the object into a dict error_dict = error_instance.to_dict() # create an instance of Error from a dict -error_form_dict = error.from_dict(error_dict) +error_from_dict = Error.from_dict(error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ErrorNoACL.md b/clients/python/docs/ErrorNoACL.md index 98afa2642db..0e4c243aaf2 100644 --- a/clients/python/docs/ErrorNoACL.md +++ b/clients/python/docs/ErrorNoACL.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of ErrorNoACL from a JSON string error_no_acl_instance = ErrorNoACL.from_json(json) # print the JSON string representation of the object -print ErrorNoACL.to_json() +print(ErrorNoACL.to_json()) # convert the object into a dict error_no_acl_dict = error_no_acl_instance.to_dict() # create an instance of ErrorNoACL from a dict -error_no_acl_form_dict = error_no_acl.from_dict(error_no_acl_dict) +error_no_acl_from_dict = ErrorNoACL.from_dict(error_no_acl_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ExperimentalApi.md b/clients/python/docs/ExperimentalApi.md index bcff98cba07..620c53f8910 100644 --- a/clients/python/docs/ExperimentalApi.md +++ b/clients/python/docs/ExperimentalApi.md @@ -32,8 +32,6 @@ Aborts a presign multipart upload. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.abort_presign_multipart_upload import AbortPresignMultipartUpload from lakefs_sdk.rest import ApiException @@ -151,8 +149,6 @@ Completes a presign multipart upload by assembling the uploaded parts. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.complete_presign_multipart_upload import CompletePresignMultipartUpload from lakefs_sdk.models.object_stats import ObjectStats @@ -274,8 +270,6 @@ Initiates a multipart upload and returns an upload ID with presigned URLs for ea * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload from lakefs_sdk.rest import ApiException @@ -391,8 +385,6 @@ attach external principal to user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation from lakefs_sdk.rest import ApiException @@ -504,8 +496,6 @@ delete external principal from user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -608,8 +598,6 @@ perform a login using an external authenticator ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.external_login_information import ExternalLoginInformation @@ -688,8 +676,6 @@ describe external principal by id * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.rest import ApiException @@ -800,8 +786,6 @@ Relocate branch to refer to ref. Branch must not contain uncommitted data. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -915,8 +899,6 @@ list user external policies attached to a user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal_list import ExternalPrincipalList from lakefs_sdk.rest import ApiException @@ -1026,8 +1008,6 @@ perform a login with STS ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.sts_auth_request import StsAuthRequest diff --git a/clients/python/docs/ExternalApi.md b/clients/python/docs/ExternalApi.md index f65514dc4f1..c2554f2154b 100644 --- a/clients/python/docs/ExternalApi.md +++ b/clients/python/docs/ExternalApi.md @@ -25,8 +25,6 @@ attach external principal to user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation from lakefs_sdk.rest import ApiException @@ -138,8 +136,6 @@ delete external principal from user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -242,8 +238,6 @@ perform a login using an external authenticator ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.external_login_information import ExternalLoginInformation @@ -322,8 +316,6 @@ describe external principal by id * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.rest import ApiException @@ -432,8 +424,6 @@ list user external policies attached to a user * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.external_principal_list import ExternalPrincipalList from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/ExternalLoginInformation.md b/clients/python/docs/ExternalLoginInformation.md index 8b454d9335a..cb413aaad21 100644 --- a/clients/python/docs/ExternalLoginInformation.md +++ b/clients/python/docs/ExternalLoginInformation.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of ExternalLoginInformation from a JSON string external_login_information_instance = ExternalLoginInformation.from_json(json) # print the JSON string representation of the object -print ExternalLoginInformation.to_json() +print(ExternalLoginInformation.to_json()) # convert the object into a dict external_login_information_dict = external_login_information_instance.to_dict() # create an instance of ExternalLoginInformation from a dict -external_login_information_form_dict = external_login_information.from_dict(external_login_information_dict) +external_login_information_from_dict = ExternalLoginInformation.from_dict(external_login_information_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ExternalPrincipal.md b/clients/python/docs/ExternalPrincipal.md index 3f2c0e538db..e621d6464f3 100644 --- a/clients/python/docs/ExternalPrincipal.md +++ b/clients/python/docs/ExternalPrincipal.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ExternalPrincipal from a JSON string external_principal_instance = ExternalPrincipal.from_json(json) # print the JSON string representation of the object -print ExternalPrincipal.to_json() +print(ExternalPrincipal.to_json()) # convert the object into a dict external_principal_dict = external_principal_instance.to_dict() # create an instance of ExternalPrincipal from a dict -external_principal_form_dict = external_principal.from_dict(external_principal_dict) +external_principal_from_dict = ExternalPrincipal.from_dict(external_principal_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ExternalPrincipalCreation.md b/clients/python/docs/ExternalPrincipalCreation.md index 4b481622ac5..b49452fecf2 100644 --- a/clients/python/docs/ExternalPrincipalCreation.md +++ b/clients/python/docs/ExternalPrincipalCreation.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of ExternalPrincipalCreation from a JSON string external_principal_creation_instance = ExternalPrincipalCreation.from_json(json) # print the JSON string representation of the object -print ExternalPrincipalCreation.to_json() +print(ExternalPrincipalCreation.to_json()) # convert the object into a dict external_principal_creation_dict = external_principal_creation_instance.to_dict() # create an instance of ExternalPrincipalCreation from a dict -external_principal_creation_form_dict = external_principal_creation.from_dict(external_principal_creation_dict) +external_principal_creation_from_dict = ExternalPrincipalCreation.from_dict(external_principal_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ExternalPrincipalList.md b/clients/python/docs/ExternalPrincipalList.md index 24d01b71339..8742654732a 100644 --- a/clients/python/docs/ExternalPrincipalList.md +++ b/clients/python/docs/ExternalPrincipalList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of ExternalPrincipalList from a JSON string external_principal_list_instance = ExternalPrincipalList.from_json(json) # print the JSON string representation of the object -print ExternalPrincipalList.to_json() +print(ExternalPrincipalList.to_json()) # convert the object into a dict external_principal_list_dict = external_principal_list_instance.to_dict() # create an instance of ExternalPrincipalList from a dict -external_principal_list_form_dict = external_principal_list.from_dict(external_principal_list_dict) +external_principal_list_from_dict = ExternalPrincipalList.from_dict(external_principal_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/FindMergeBaseResult.md b/clients/python/docs/FindMergeBaseResult.md index ce1a9121188..f24d029ef23 100644 --- a/clients/python/docs/FindMergeBaseResult.md +++ b/clients/python/docs/FindMergeBaseResult.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of FindMergeBaseResult from a JSON string find_merge_base_result_instance = FindMergeBaseResult.from_json(json) # print the JSON string representation of the object -print FindMergeBaseResult.to_json() +print(FindMergeBaseResult.to_json()) # convert the object into a dict find_merge_base_result_dict = find_merge_base_result_instance.to_dict() # create an instance of FindMergeBaseResult from a dict -find_merge_base_result_form_dict = find_merge_base_result.from_dict(find_merge_base_result_dict) +find_merge_base_result_from_dict = FindMergeBaseResult.from_dict(find_merge_base_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/GarbageCollectionConfig.md b/clients/python/docs/GarbageCollectionConfig.md index 1288be12d20..20ca56d0cde 100644 --- a/clients/python/docs/GarbageCollectionConfig.md +++ b/clients/python/docs/GarbageCollectionConfig.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of GarbageCollectionConfig from a JSON string garbage_collection_config_instance = GarbageCollectionConfig.from_json(json) # print the JSON string representation of the object -print GarbageCollectionConfig.to_json() +print(GarbageCollectionConfig.to_json()) # convert the object into a dict garbage_collection_config_dict = garbage_collection_config_instance.to_dict() # create an instance of GarbageCollectionConfig from a dict -garbage_collection_config_form_dict = garbage_collection_config.from_dict(garbage_collection_config_dict) +garbage_collection_config_from_dict = GarbageCollectionConfig.from_dict(garbage_collection_config_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/GarbageCollectionPrepareResponse.md b/clients/python/docs/GarbageCollectionPrepareResponse.md index bd3d767589a..891132beee6 100644 --- a/clients/python/docs/GarbageCollectionPrepareResponse.md +++ b/clients/python/docs/GarbageCollectionPrepareResponse.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of GarbageCollectionPrepareResponse from a JSON string garbage_collection_prepare_response_instance = GarbageCollectionPrepareResponse.from_json(json) # print the JSON string representation of the object -print GarbageCollectionPrepareResponse.to_json() +print(GarbageCollectionPrepareResponse.to_json()) # convert the object into a dict garbage_collection_prepare_response_dict = garbage_collection_prepare_response_instance.to_dict() # create an instance of GarbageCollectionPrepareResponse from a dict -garbage_collection_prepare_response_form_dict = garbage_collection_prepare_response.from_dict(garbage_collection_prepare_response_dict) +garbage_collection_prepare_response_from_dict = GarbageCollectionPrepareResponse.from_dict(garbage_collection_prepare_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/GarbageCollectionRule.md b/clients/python/docs/GarbageCollectionRule.md index 12aaf92c0b5..05fee488d9e 100644 --- a/clients/python/docs/GarbageCollectionRule.md +++ b/clients/python/docs/GarbageCollectionRule.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of GarbageCollectionRule from a JSON string garbage_collection_rule_instance = GarbageCollectionRule.from_json(json) # print the JSON string representation of the object -print GarbageCollectionRule.to_json() +print(GarbageCollectionRule.to_json()) # convert the object into a dict garbage_collection_rule_dict = garbage_collection_rule_instance.to_dict() # create an instance of GarbageCollectionRule from a dict -garbage_collection_rule_form_dict = garbage_collection_rule.from_dict(garbage_collection_rule_dict) +garbage_collection_rule_from_dict = GarbageCollectionRule.from_dict(garbage_collection_rule_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/GarbageCollectionRules.md b/clients/python/docs/GarbageCollectionRules.md index 694ae30daa9..1cc0004c493 100644 --- a/clients/python/docs/GarbageCollectionRules.md +++ b/clients/python/docs/GarbageCollectionRules.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of GarbageCollectionRules from a JSON string garbage_collection_rules_instance = GarbageCollectionRules.from_json(json) # print the JSON string representation of the object -print GarbageCollectionRules.to_json() +print(GarbageCollectionRules.to_json()) # convert the object into a dict garbage_collection_rules_dict = garbage_collection_rules_instance.to_dict() # create an instance of GarbageCollectionRules from a dict -garbage_collection_rules_form_dict = garbage_collection_rules.from_dict(garbage_collection_rules_dict) +garbage_collection_rules_from_dict = GarbageCollectionRules.from_dict(garbage_collection_rules_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Group.md b/clients/python/docs/Group.md index c8376fe2cd6..49d37350e19 100644 --- a/clients/python/docs/Group.md +++ b/clients/python/docs/Group.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of Group from a JSON string group_instance = Group.from_json(json) # print the JSON string representation of the object -print Group.to_json() +print(Group.to_json()) # convert the object into a dict group_dict = group_instance.to_dict() # create an instance of Group from a dict -group_form_dict = group.from_dict(group_dict) +group_from_dict = Group.from_dict(group_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/GroupCreation.md b/clients/python/docs/GroupCreation.md index c2afe03feec..88405535f71 100644 --- a/clients/python/docs/GroupCreation.md +++ b/clients/python/docs/GroupCreation.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of GroupCreation from a JSON string group_creation_instance = GroupCreation.from_json(json) # print the JSON string representation of the object -print GroupCreation.to_json() +print(GroupCreation.to_json()) # convert the object into a dict group_creation_dict = group_creation_instance.to_dict() # create an instance of GroupCreation from a dict -group_creation_form_dict = group_creation.from_dict(group_creation_dict) +group_creation_from_dict = GroupCreation.from_dict(group_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/GroupList.md b/clients/python/docs/GroupList.md index 577c4580785..d03961e62c4 100644 --- a/clients/python/docs/GroupList.md +++ b/clients/python/docs/GroupList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of GroupList from a JSON string group_list_instance = GroupList.from_json(json) # print the JSON string representation of the object -print GroupList.to_json() +print(GroupList.to_json()) # convert the object into a dict group_list_dict = group_list_instance.to_dict() # create an instance of GroupList from a dict -group_list_form_dict = group_list.from_dict(group_list_dict) +group_list_from_dict = GroupList.from_dict(group_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/HealthCheckApi.md b/clients/python/docs/HealthCheckApi.md index 3c3572d0817..ed6ecc57091 100644 --- a/clients/python/docs/HealthCheckApi.md +++ b/clients/python/docs/HealthCheckApi.md @@ -18,8 +18,6 @@ check that the API server is up and running ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint diff --git a/clients/python/docs/HookRun.md b/clients/python/docs/HookRun.md index 90f6392bba3..545296e7720 100644 --- a/clients/python/docs/HookRun.md +++ b/clients/python/docs/HookRun.md @@ -22,12 +22,12 @@ json = "{}" # create an instance of HookRun from a JSON string hook_run_instance = HookRun.from_json(json) # print the JSON string representation of the object -print HookRun.to_json() +print(HookRun.to_json()) # convert the object into a dict hook_run_dict = hook_run_instance.to_dict() # create an instance of HookRun from a dict -hook_run_form_dict = hook_run.from_dict(hook_run_dict) +hook_run_from_dict = HookRun.from_dict(hook_run_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/HookRunList.md b/clients/python/docs/HookRunList.md index 741a0e3d1e6..da0eef62705 100644 --- a/clients/python/docs/HookRunList.md +++ b/clients/python/docs/HookRunList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of HookRunList from a JSON string hook_run_list_instance = HookRunList.from_json(json) # print the JSON string representation of the object -print HookRunList.to_json() +print(HookRunList.to_json()) # convert the object into a dict hook_run_list_dict = hook_run_list_instance.to_dict() # create an instance of HookRunList from a dict -hook_run_list_form_dict = hook_run_list.from_dict(hook_run_list_dict) +hook_run_list_from_dict = HookRunList.from_dict(hook_run_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ImportApi.md b/clients/python/docs/ImportApi.md index 496f2ac4369..c57d451d402 100644 --- a/clients/python/docs/ImportApi.md +++ b/clients/python/docs/ImportApi.md @@ -23,8 +23,6 @@ cancel ongoing import * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -136,8 +134,6 @@ import data from object store * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.import_creation import ImportCreation from lakefs_sdk.models.import_creation_response import ImportCreationResponse @@ -253,8 +249,6 @@ get import status * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.import_status import ImportStatus from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/ImportCreation.md b/clients/python/docs/ImportCreation.md index 77b29c152f2..3c5cddf3f0a 100644 --- a/clients/python/docs/ImportCreation.md +++ b/clients/python/docs/ImportCreation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ImportCreation from a JSON string import_creation_instance = ImportCreation.from_json(json) # print the JSON string representation of the object -print ImportCreation.to_json() +print(ImportCreation.to_json()) # convert the object into a dict import_creation_dict = import_creation_instance.to_dict() # create an instance of ImportCreation from a dict -import_creation_form_dict = import_creation.from_dict(import_creation_dict) +import_creation_from_dict = ImportCreation.from_dict(import_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ImportCreationResponse.md b/clients/python/docs/ImportCreationResponse.md index d1992ad35d5..df6d7dde8ea 100644 --- a/clients/python/docs/ImportCreationResponse.md +++ b/clients/python/docs/ImportCreationResponse.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of ImportCreationResponse from a JSON string import_creation_response_instance = ImportCreationResponse.from_json(json) # print the JSON string representation of the object -print ImportCreationResponse.to_json() +print(ImportCreationResponse.to_json()) # convert the object into a dict import_creation_response_dict = import_creation_response_instance.to_dict() # create an instance of ImportCreationResponse from a dict -import_creation_response_form_dict = import_creation_response.from_dict(import_creation_response_dict) +import_creation_response_from_dict = ImportCreationResponse.from_dict(import_creation_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ImportLocation.md b/clients/python/docs/ImportLocation.md index 52d60d178ed..9a3a227bcd3 100644 --- a/clients/python/docs/ImportLocation.md +++ b/clients/python/docs/ImportLocation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ImportLocation from a JSON string import_location_instance = ImportLocation.from_json(json) # print the JSON string representation of the object -print ImportLocation.to_json() +print(ImportLocation.to_json()) # convert the object into a dict import_location_dict = import_location_instance.to_dict() # create an instance of ImportLocation from a dict -import_location_form_dict = import_location.from_dict(import_location_dict) +import_location_from_dict = ImportLocation.from_dict(import_location_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ImportStatus.md b/clients/python/docs/ImportStatus.md index 850ddb45046..7dd00a035a8 100644 --- a/clients/python/docs/ImportStatus.md +++ b/clients/python/docs/ImportStatus.md @@ -22,12 +22,12 @@ json = "{}" # create an instance of ImportStatus from a JSON string import_status_instance = ImportStatus.from_json(json) # print the JSON string representation of the object -print ImportStatus.to_json() +print(ImportStatus.to_json()) # convert the object into a dict import_status_dict = import_status_instance.to_dict() # create an instance of ImportStatus from a dict -import_status_form_dict = import_status.from_dict(import_status_dict) +import_status_from_dict = ImportStatus.from_dict(import_status_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/InstallationUsageReport.md b/clients/python/docs/InstallationUsageReport.md index 27ec304d25f..0b604f36135 100644 --- a/clients/python/docs/InstallationUsageReport.md +++ b/clients/python/docs/InstallationUsageReport.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of InstallationUsageReport from a JSON string installation_usage_report_instance = InstallationUsageReport.from_json(json) # print the JSON string representation of the object -print InstallationUsageReport.to_json() +print(InstallationUsageReport.to_json()) # convert the object into a dict installation_usage_report_dict = installation_usage_report_instance.to_dict() # create an instance of InstallationUsageReport from a dict -installation_usage_report_form_dict = installation_usage_report.from_dict(installation_usage_report_dict) +installation_usage_report_from_dict = InstallationUsageReport.from_dict(installation_usage_report_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/InternalApi.md b/clients/python/docs/InternalApi.md index 276bcbb418b..f196342b7ec 100644 --- a/clients/python/docs/InternalApi.md +++ b/clients/python/docs/InternalApi.md @@ -48,8 +48,6 @@ Method | HTTP request | Description * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -155,8 +153,6 @@ create commit record * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.commit_record_creation import CommitRecordCreation from lakefs_sdk.rest import ApiException @@ -267,8 +263,6 @@ creates symlink files corresponding to the given directory * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.storage_uri import StorageURI from lakefs_sdk.rest import ApiException @@ -383,8 +377,6 @@ Delete specified keys from the repository's metadata. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository_metadata_keys import RepositoryMetadataKeys from lakefs_sdk.rest import ApiException @@ -492,8 +484,6 @@ Dump repository refs (tags, commits, branches) to object store Deprecated: a new * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.refs_dump import RefsDump from lakefs_sdk.rest import ApiException @@ -598,8 +588,6 @@ list authentication capabilities supported ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.auth_capabilities import AuthCapabilities from lakefs_sdk.rest import ApiException @@ -671,8 +659,6 @@ get information of gc settings * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.garbage_collection_config import GarbageCollectionConfig from lakefs_sdk.rest import ApiException @@ -775,8 +761,6 @@ get version of lakeFS server * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.version_config import VersionConfig from lakefs_sdk.rest import ApiException @@ -877,8 +861,6 @@ return a lakeFS metadata object by ID * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -988,8 +970,6 @@ check if the lakeFS installation is already set up ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.setup_state import SetupState from lakefs_sdk.rest import ApiException @@ -1061,8 +1041,6 @@ retrieve lakeFS storage configuration * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.storage_config import StorageConfig from lakefs_sdk.rest import ApiException @@ -1163,8 +1141,6 @@ get usage report summary * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.installation_usage_report import InstallationUsageReport from lakefs_sdk.rest import ApiException @@ -1270,8 +1246,6 @@ This endpoint does not need any parameter. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule from lakefs_sdk.rest import ApiException @@ -1379,8 +1353,6 @@ void (empty response body) * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.internal_delete_branch_protection_rule_request import InternalDeleteBranchProtectionRuleRequest from lakefs_sdk.rest import ApiException @@ -1488,8 +1460,6 @@ void (empty response body) * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1594,8 +1564,6 @@ get branch protection rules * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule from lakefs_sdk.rest import ApiException @@ -1704,8 +1672,6 @@ Name | Type | Description | Notes * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules from lakefs_sdk.rest import ApiException @@ -1813,8 +1779,6 @@ Name | Type | Description | Notes * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules from lakefs_sdk.rest import ApiException @@ -1922,8 +1886,6 @@ post stats events, this endpoint is meant for internal use only * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.stats_events_list import StatsEventsList from lakefs_sdk.rest import ApiException @@ -2030,8 +1992,6 @@ save lists of active commits for garbage collection * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.garbage_collection_prepare_response import GarbageCollectionPrepareResponse from lakefs_sdk.rest import ApiException @@ -2141,8 +2101,6 @@ save repository uncommitted metadata for garbage collection * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.prepare_gc_uncommitted_request import PrepareGCUncommittedRequest from lakefs_sdk.models.prepare_gc_uncommitted_response import PrepareGCUncommittedResponse @@ -2256,8 +2214,6 @@ Restore repository refs (tags, commits, branches) from object store. Deprecated: * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.refs_restore import RefsRestore from lakefs_sdk.rest import ApiException @@ -2367,8 +2323,6 @@ void (empty response body) * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -2475,8 +2429,6 @@ Set repository metadata. This will only add or update the provided keys, and wil * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository_metadata_set import RepositoryMetadataSet from lakefs_sdk.rest import ApiException @@ -2580,8 +2532,6 @@ setup lakeFS and create a first user ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.credentials_with_secret import CredentialsWithSecret from lakefs_sdk.models.setup import Setup @@ -2653,8 +2603,6 @@ setup communications preferences ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.comm_prefs_input import CommPrefsInput from lakefs_sdk.rest import ApiException @@ -2728,8 +2676,6 @@ stage an object's metadata for the given branch * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_stage_creation import ObjectStageCreation from lakefs_sdk.models.object_stats import ObjectStats @@ -2847,8 +2793,6 @@ Name | Type | Description | Notes * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint diff --git a/clients/python/docs/InternalDeleteBranchProtectionRuleRequest.md b/clients/python/docs/InternalDeleteBranchProtectionRuleRequest.md index 1c072c0adcf..6d8ed713faa 100644 --- a/clients/python/docs/InternalDeleteBranchProtectionRuleRequest.md +++ b/clients/python/docs/InternalDeleteBranchProtectionRuleRequest.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of InternalDeleteBranchProtectionRuleRequest from a JSON string internal_delete_branch_protection_rule_request_instance = InternalDeleteBranchProtectionRuleRequest.from_json(json) # print the JSON string representation of the object -print InternalDeleteBranchProtectionRuleRequest.to_json() +print(InternalDeleteBranchProtectionRuleRequest.to_json()) # convert the object into a dict internal_delete_branch_protection_rule_request_dict = internal_delete_branch_protection_rule_request_instance.to_dict() # create an instance of InternalDeleteBranchProtectionRuleRequest from a dict -internal_delete_branch_protection_rule_request_form_dict = internal_delete_branch_protection_rule_request.from_dict(internal_delete_branch_protection_rule_request_dict) +internal_delete_branch_protection_rule_request_from_dict = InternalDeleteBranchProtectionRuleRequest.from_dict(internal_delete_branch_protection_rule_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/LoginConfig.md b/clients/python/docs/LoginConfig.md index c154bfd3a7e..a20c8de1613 100644 --- a/clients/python/docs/LoginConfig.md +++ b/clients/python/docs/LoginConfig.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of LoginConfig from a JSON string login_config_instance = LoginConfig.from_json(json) # print the JSON string representation of the object -print LoginConfig.to_json() +print(LoginConfig.to_json()) # convert the object into a dict login_config_dict = login_config_instance.to_dict() # create an instance of LoginConfig from a dict -login_config_form_dict = login_config.from_dict(login_config_dict) +login_config_from_dict = LoginConfig.from_dict(login_config_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/LoginInformation.md b/clients/python/docs/LoginInformation.md index 8f200b49659..36f2cda3519 100644 --- a/clients/python/docs/LoginInformation.md +++ b/clients/python/docs/LoginInformation.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of LoginInformation from a JSON string login_information_instance = LoginInformation.from_json(json) # print the JSON string representation of the object -print LoginInformation.to_json() +print(LoginInformation.to_json()) # convert the object into a dict login_information_dict = login_information_instance.to_dict() # create an instance of LoginInformation from a dict -login_information_form_dict = login_information.from_dict(login_information_dict) +login_information_from_dict = LoginInformation.from_dict(login_information_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Merge.md b/clients/python/docs/Merge.md index 6b0e40f1083..8899860853c 100644 --- a/clients/python/docs/Merge.md +++ b/clients/python/docs/Merge.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of Merge from a JSON string merge_instance = Merge.from_json(json) # print the JSON string representation of the object -print Merge.to_json() +print(Merge.to_json()) # convert the object into a dict merge_dict = merge_instance.to_dict() # create an instance of Merge from a dict -merge_form_dict = merge.from_dict(merge_dict) +merge_from_dict = Merge.from_dict(merge_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/MergeResult.md b/clients/python/docs/MergeResult.md index 4babd96d5b8..1b14e4d325b 100644 --- a/clients/python/docs/MergeResult.md +++ b/clients/python/docs/MergeResult.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of MergeResult from a JSON string merge_result_instance = MergeResult.from_json(json) # print the JSON string representation of the object -print MergeResult.to_json() +print(MergeResult.to_json()) # convert the object into a dict merge_result_dict = merge_result_instance.to_dict() # create an instance of MergeResult from a dict -merge_result_form_dict = merge_result.from_dict(merge_result_dict) +merge_result_from_dict = MergeResult.from_dict(merge_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/MetaRangeCreation.md b/clients/python/docs/MetaRangeCreation.md index c04cf212f59..c939609cfbe 100644 --- a/clients/python/docs/MetaRangeCreation.md +++ b/clients/python/docs/MetaRangeCreation.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of MetaRangeCreation from a JSON string meta_range_creation_instance = MetaRangeCreation.from_json(json) # print the JSON string representation of the object -print MetaRangeCreation.to_json() +print(MetaRangeCreation.to_json()) # convert the object into a dict meta_range_creation_dict = meta_range_creation_instance.to_dict() # create an instance of MetaRangeCreation from a dict -meta_range_creation_form_dict = meta_range_creation.from_dict(meta_range_creation_dict) +meta_range_creation_from_dict = MetaRangeCreation.from_dict(meta_range_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/MetaRangeCreationResponse.md b/clients/python/docs/MetaRangeCreationResponse.md index 827a69e6807..3f94d608b95 100644 --- a/clients/python/docs/MetaRangeCreationResponse.md +++ b/clients/python/docs/MetaRangeCreationResponse.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of MetaRangeCreationResponse from a JSON string meta_range_creation_response_instance = MetaRangeCreationResponse.from_json(json) # print the JSON string representation of the object -print MetaRangeCreationResponse.to_json() +print(MetaRangeCreationResponse.to_json()) # convert the object into a dict meta_range_creation_response_dict = meta_range_creation_response_instance.to_dict() # create an instance of MetaRangeCreationResponse from a dict -meta_range_creation_response_form_dict = meta_range_creation_response.from_dict(meta_range_creation_response_dict) +meta_range_creation_response_from_dict = MetaRangeCreationResponse.from_dict(meta_range_creation_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/MetadataApi.md b/clients/python/docs/MetadataApi.md index 248e02e2629..861b03c716d 100644 --- a/clients/python/docs/MetadataApi.md +++ b/clients/python/docs/MetadataApi.md @@ -22,8 +22,6 @@ return URI to a meta-range file * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.storage_uri import StorageURI from lakefs_sdk.rest import ApiException @@ -134,8 +132,6 @@ return URI to a range file * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.storage_uri import StorageURI from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/ObjectCopyCreation.md b/clients/python/docs/ObjectCopyCreation.md index 1f6687f7a83..2dd412a0e4b 100644 --- a/clients/python/docs/ObjectCopyCreation.md +++ b/clients/python/docs/ObjectCopyCreation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ObjectCopyCreation from a JSON string object_copy_creation_instance = ObjectCopyCreation.from_json(json) # print the JSON string representation of the object -print ObjectCopyCreation.to_json() +print(ObjectCopyCreation.to_json()) # convert the object into a dict object_copy_creation_dict = object_copy_creation_instance.to_dict() # create an instance of ObjectCopyCreation from a dict -object_copy_creation_form_dict = object_copy_creation.from_dict(object_copy_creation_dict) +object_copy_creation_from_dict = ObjectCopyCreation.from_dict(object_copy_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ObjectError.md b/clients/python/docs/ObjectError.md index 06ded331214..0c3cd444629 100644 --- a/clients/python/docs/ObjectError.md +++ b/clients/python/docs/ObjectError.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ObjectError from a JSON string object_error_instance = ObjectError.from_json(json) # print the JSON string representation of the object -print ObjectError.to_json() +print(ObjectError.to_json()) # convert the object into a dict object_error_dict = object_error_instance.to_dict() # create an instance of ObjectError from a dict -object_error_form_dict = object_error.from_dict(object_error_dict) +object_error_from_dict = ObjectError.from_dict(object_error_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ObjectErrorList.md b/clients/python/docs/ObjectErrorList.md index 44d827f29f2..8805a6c6560 100644 --- a/clients/python/docs/ObjectErrorList.md +++ b/clients/python/docs/ObjectErrorList.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of ObjectErrorList from a JSON string object_error_list_instance = ObjectErrorList.from_json(json) # print the JSON string representation of the object -print ObjectErrorList.to_json() +print(ObjectErrorList.to_json()) # convert the object into a dict object_error_list_dict = object_error_list_instance.to_dict() # create an instance of ObjectErrorList from a dict -object_error_list_form_dict = object_error_list.from_dict(object_error_list_dict) +object_error_list_from_dict = ObjectErrorList.from_dict(object_error_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ObjectStageCreation.md b/clients/python/docs/ObjectStageCreation.md index 661894e1d25..f3ce2341194 100644 --- a/clients/python/docs/ObjectStageCreation.md +++ b/clients/python/docs/ObjectStageCreation.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of ObjectStageCreation from a JSON string object_stage_creation_instance = ObjectStageCreation.from_json(json) # print the JSON string representation of the object -print ObjectStageCreation.to_json() +print(ObjectStageCreation.to_json()) # convert the object into a dict object_stage_creation_dict = object_stage_creation_instance.to_dict() # create an instance of ObjectStageCreation from a dict -object_stage_creation_form_dict = object_stage_creation.from_dict(object_stage_creation_dict) +object_stage_creation_from_dict = ObjectStageCreation.from_dict(object_stage_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ObjectStats.md b/clients/python/docs/ObjectStats.md index 2f94708e3af..183d69f686a 100644 --- a/clients/python/docs/ObjectStats.md +++ b/clients/python/docs/ObjectStats.md @@ -25,12 +25,12 @@ json = "{}" # create an instance of ObjectStats from a JSON string object_stats_instance = ObjectStats.from_json(json) # print the JSON string representation of the object -print ObjectStats.to_json() +print(ObjectStats.to_json()) # convert the object into a dict object_stats_dict = object_stats_instance.to_dict() # create an instance of ObjectStats from a dict -object_stats_form_dict = object_stats.from_dict(object_stats_dict) +object_stats_from_dict = ObjectStats.from_dict(object_stats_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ObjectStatsList.md b/clients/python/docs/ObjectStatsList.md index 90676d2c7c0..353780ba1ea 100644 --- a/clients/python/docs/ObjectStatsList.md +++ b/clients/python/docs/ObjectStatsList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of ObjectStatsList from a JSON string object_stats_list_instance = ObjectStatsList.from_json(json) # print the JSON string representation of the object -print ObjectStatsList.to_json() +print(ObjectStatsList.to_json()) # convert the object into a dict object_stats_list_dict = object_stats_list_instance.to_dict() # create an instance of ObjectStatsList from a dict -object_stats_list_form_dict = object_stats_list.from_dict(object_stats_list_dict) +object_stats_list_from_dict = ObjectStatsList.from_dict(object_stats_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ObjectsApi.md b/clients/python/docs/ObjectsApi.md index a9ab5b4e74a..958130792c4 100644 --- a/clients/python/docs/ObjectsApi.md +++ b/clients/python/docs/ObjectsApi.md @@ -29,8 +29,6 @@ create a copy of an object * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation from lakefs_sdk.models.object_stats import ObjectStats @@ -148,8 +146,6 @@ delete object. Missing objects will not return a NotFound error. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -262,8 +258,6 @@ delete objects. Missing objects will not return a NotFound error. * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_error_list import ObjectErrorList from lakefs_sdk.models.path_list import PathList @@ -380,8 +374,6 @@ get object content * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -504,8 +496,6 @@ get object properties on underlying storage * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties from lakefs_sdk.rest import ApiException @@ -618,8 +608,6 @@ check if object exists * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -734,8 +722,6 @@ list objects under a given prefix * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_stats_list import ObjectStatsList from lakefs_sdk.rest import ApiException @@ -858,8 +844,6 @@ get object metadata * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.rest import ApiException @@ -978,8 +962,6 @@ Name | Type | Description | Notes * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/Pagination.md b/clients/python/docs/Pagination.md index bcdfafd1323..3a1eb813028 100644 --- a/clients/python/docs/Pagination.md +++ b/clients/python/docs/Pagination.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of Pagination from a JSON string pagination_instance = Pagination.from_json(json) # print the JSON string representation of the object -print Pagination.to_json() +print(Pagination.to_json()) # convert the object into a dict pagination_dict = pagination_instance.to_dict() # create an instance of Pagination from a dict -pagination_form_dict = pagination.from_dict(pagination_dict) +pagination_from_dict = Pagination.from_dict(pagination_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/PathList.md b/clients/python/docs/PathList.md index 8761b8cc08e..3e876bbb743 100644 --- a/clients/python/docs/PathList.md +++ b/clients/python/docs/PathList.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of PathList from a JSON string path_list_instance = PathList.from_json(json) # print the JSON string representation of the object -print PathList.to_json() +print(PathList.to_json()) # convert the object into a dict path_list_dict = path_list_instance.to_dict() # create an instance of PathList from a dict -path_list_form_dict = path_list.from_dict(path_list_dict) +path_list_from_dict = PathList.from_dict(path_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Policy.md b/clients/python/docs/Policy.md index a3882e4193c..1e257b53baa 100644 --- a/clients/python/docs/Policy.md +++ b/clients/python/docs/Policy.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of Policy from a JSON string policy_instance = Policy.from_json(json) # print the JSON string representation of the object -print Policy.to_json() +print(Policy.to_json()) # convert the object into a dict policy_dict = policy_instance.to_dict() # create an instance of Policy from a dict -policy_form_dict = policy.from_dict(policy_dict) +policy_from_dict = Policy.from_dict(policy_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/PolicyList.md b/clients/python/docs/PolicyList.md index a0c74f71b47..343a75f985c 100644 --- a/clients/python/docs/PolicyList.md +++ b/clients/python/docs/PolicyList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of PolicyList from a JSON string policy_list_instance = PolicyList.from_json(json) # print the JSON string representation of the object -print PolicyList.to_json() +print(PolicyList.to_json()) # convert the object into a dict policy_list_dict = policy_list_instance.to_dict() # create an instance of PolicyList from a dict -policy_list_form_dict = policy_list.from_dict(policy_list_dict) +policy_list_from_dict = PolicyList.from_dict(policy_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/PrepareGCUncommittedRequest.md b/clients/python/docs/PrepareGCUncommittedRequest.md index 486b76b2a43..96bf89178f7 100644 --- a/clients/python/docs/PrepareGCUncommittedRequest.md +++ b/clients/python/docs/PrepareGCUncommittedRequest.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of PrepareGCUncommittedRequest from a JSON string prepare_gc_uncommitted_request_instance = PrepareGCUncommittedRequest.from_json(json) # print the JSON string representation of the object -print PrepareGCUncommittedRequest.to_json() +print(PrepareGCUncommittedRequest.to_json()) # convert the object into a dict prepare_gc_uncommitted_request_dict = prepare_gc_uncommitted_request_instance.to_dict() # create an instance of PrepareGCUncommittedRequest from a dict -prepare_gc_uncommitted_request_form_dict = prepare_gc_uncommitted_request.from_dict(prepare_gc_uncommitted_request_dict) +prepare_gc_uncommitted_request_from_dict = PrepareGCUncommittedRequest.from_dict(prepare_gc_uncommitted_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/PrepareGCUncommittedResponse.md b/clients/python/docs/PrepareGCUncommittedResponse.md index f8085c2d8b4..340b280b867 100644 --- a/clients/python/docs/PrepareGCUncommittedResponse.md +++ b/clients/python/docs/PrepareGCUncommittedResponse.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of PrepareGCUncommittedResponse from a JSON string prepare_gc_uncommitted_response_instance = PrepareGCUncommittedResponse.from_json(json) # print the JSON string representation of the object -print PrepareGCUncommittedResponse.to_json() +print(PrepareGCUncommittedResponse.to_json()) # convert the object into a dict prepare_gc_uncommitted_response_dict = prepare_gc_uncommitted_response_instance.to_dict() # create an instance of PrepareGCUncommittedResponse from a dict -prepare_gc_uncommitted_response_form_dict = prepare_gc_uncommitted_response.from_dict(prepare_gc_uncommitted_response_dict) +prepare_gc_uncommitted_response_from_dict = PrepareGCUncommittedResponse.from_dict(prepare_gc_uncommitted_response_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/PresignMultipartUpload.md b/clients/python/docs/PresignMultipartUpload.md index e9a1619f8dc..83d1e8b0b29 100644 --- a/clients/python/docs/PresignMultipartUpload.md +++ b/clients/python/docs/PresignMultipartUpload.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of PresignMultipartUpload from a JSON string presign_multipart_upload_instance = PresignMultipartUpload.from_json(json) # print the JSON string representation of the object -print PresignMultipartUpload.to_json() +print(PresignMultipartUpload.to_json()) # convert the object into a dict presign_multipart_upload_dict = presign_multipart_upload_instance.to_dict() # create an instance of PresignMultipartUpload from a dict -presign_multipart_upload_form_dict = presign_multipart_upload.from_dict(presign_multipart_upload_dict) +presign_multipart_upload_from_dict = PresignMultipartUpload.from_dict(presign_multipart_upload_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RangeMetadata.md b/clients/python/docs/RangeMetadata.md index f4180d9581c..4aa40af9370 100644 --- a/clients/python/docs/RangeMetadata.md +++ b/clients/python/docs/RangeMetadata.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of RangeMetadata from a JSON string range_metadata_instance = RangeMetadata.from_json(json) # print the JSON string representation of the object -print RangeMetadata.to_json() +print(RangeMetadata.to_json()) # convert the object into a dict range_metadata_dict = range_metadata_instance.to_dict() # create an instance of RangeMetadata from a dict -range_metadata_form_dict = range_metadata.from_dict(range_metadata_dict) +range_metadata_from_dict = RangeMetadata.from_dict(range_metadata_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Ref.md b/clients/python/docs/Ref.md index 7cb1124d5d9..bd0d2c92b59 100644 --- a/clients/python/docs/Ref.md +++ b/clients/python/docs/Ref.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of Ref from a JSON string ref_instance = Ref.from_json(json) # print the JSON string representation of the object -print Ref.to_json() +print(Ref.to_json()) # convert the object into a dict ref_dict = ref_instance.to_dict() # create an instance of Ref from a dict -ref_form_dict = ref.from_dict(ref_dict) +ref_from_dict = Ref.from_dict(ref_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RefList.md b/clients/python/docs/RefList.md index 71a0e4a33c0..368499aa3c9 100644 --- a/clients/python/docs/RefList.md +++ b/clients/python/docs/RefList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of RefList from a JSON string ref_list_instance = RefList.from_json(json) # print the JSON string representation of the object -print RefList.to_json() +print(RefList.to_json()) # convert the object into a dict ref_list_dict = ref_list_instance.to_dict() # create an instance of RefList from a dict -ref_list_form_dict = ref_list.from_dict(ref_list_dict) +ref_list_from_dict = RefList.from_dict(ref_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RefsApi.md b/clients/python/docs/RefsApi.md index ac999a2ff24..ef01805261f 100644 --- a/clients/python/docs/RefsApi.md +++ b/clients/python/docs/RefsApi.md @@ -24,8 +24,6 @@ diff references * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.diff_list import DiffList from lakefs_sdk.rest import ApiException @@ -82,7 +80,7 @@ with lakefs_sdk.ApiClient(configuration) as api_client: amount = 100 # int | how many items to return (optional) (default to 100) prefix = 'prefix_example' # str | return items prefixed with this value (optional) delimiter = 'delimiter_example' # str | delimiter used to group common prefixes by (optional) - type = 'three_dot' # str | (optional) (default to 'three_dot') + type = three_dot # str | (optional) (default to three_dot) try: # diff references @@ -107,7 +105,7 @@ Name | Type | Description | Notes **amount** | **int**| how many items to return | [optional] [default to 100] **prefix** | **str**| return items prefixed with this value | [optional] **delimiter** | **str**| delimiter used to group common prefixes by | [optional] - **type** | **str**| | [optional] [default to 'three_dot'] + **type** | **str**| | [optional] [default to three_dot] ### Return type @@ -148,8 +146,6 @@ find the merge base for 2 references * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.find_merge_base_result import FindMergeBaseResult from lakefs_sdk.rest import ApiException @@ -263,8 +259,6 @@ get commit log from ref. If both objects and prefixes are empty, return all comm * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.commit_list import CommitList from lakefs_sdk.rest import ApiException @@ -391,8 +385,6 @@ merge references * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.merge import Merge from lakefs_sdk.models.merge_result import MergeResult diff --git a/clients/python/docs/RefsDump.md b/clients/python/docs/RefsDump.md index b23cae4fc63..7ed49b6f7f3 100644 --- a/clients/python/docs/RefsDump.md +++ b/clients/python/docs/RefsDump.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of RefsDump from a JSON string refs_dump_instance = RefsDump.from_json(json) # print the JSON string representation of the object -print RefsDump.to_json() +print(RefsDump.to_json()) # convert the object into a dict refs_dump_dict = refs_dump_instance.to_dict() # create an instance of RefsDump from a dict -refs_dump_form_dict = refs_dump.from_dict(refs_dump_dict) +refs_dump_from_dict = RefsDump.from_dict(refs_dump_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RefsRestore.md b/clients/python/docs/RefsRestore.md index 000af8e1846..75cca36276f 100644 --- a/clients/python/docs/RefsRestore.md +++ b/clients/python/docs/RefsRestore.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of RefsRestore from a JSON string refs_restore_instance = RefsRestore.from_json(json) # print the JSON string representation of the object -print RefsRestore.to_json() +print(RefsRestore.to_json()) # convert the object into a dict refs_restore_dict = refs_restore_instance.to_dict() # create an instance of RefsRestore from a dict -refs_restore_form_dict = refs_restore.from_dict(refs_restore_dict) +refs_restore_from_dict = RefsRestore.from_dict(refs_restore_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoriesApi.md b/clients/python/docs/RepositoriesApi.md index 6db6216fc8d..87a1835dc4c 100644 --- a/clients/python/docs/RepositoriesApi.md +++ b/clients/python/docs/RepositoriesApi.md @@ -34,8 +34,6 @@ create repository * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository import Repository from lakefs_sdk.models.repository_creation import RepositoryCreation @@ -148,8 +146,6 @@ Name | Type | Description | Notes * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -255,8 +251,6 @@ delete repository * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -364,8 +358,6 @@ Status of a repository dump task * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository_dump_status import RepositoryDumpStatus from lakefs_sdk.rest import ApiException @@ -477,8 +469,6 @@ Backup the repository metadata (tags, commits, branches) and save the backup to * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.task_info import TaskInfo from lakefs_sdk.rest import ApiException @@ -587,8 +577,6 @@ get branch protection rules * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule from lakefs_sdk.rest import ApiException @@ -697,8 +685,6 @@ get repository GC rules * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules from lakefs_sdk.rest import ApiException @@ -807,8 +793,6 @@ get repository * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository import Repository from lakefs_sdk.rest import ApiException @@ -917,8 +901,6 @@ get repository metadata * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -1026,8 +1008,6 @@ list repositories * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository_list import RepositoryList from lakefs_sdk.rest import ApiException @@ -1139,8 +1119,6 @@ Status of a restore request * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.repository_restore_status import RepositoryRestoreStatus from lakefs_sdk.rest import ApiException @@ -1252,8 +1230,6 @@ Restore repository from a dump in the object store * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.refs_restore import RefsRestore from lakefs_sdk.models.task_info import TaskInfo @@ -1366,8 +1342,6 @@ Name | Type | Description | Notes * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule from lakefs_sdk.rest import ApiException @@ -1480,8 +1454,6 @@ void (empty response body) * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/Repository.md b/clients/python/docs/Repository.md index 9a26acf43dd..b9beaa02473 100644 --- a/clients/python/docs/Repository.md +++ b/clients/python/docs/Repository.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of Repository from a JSON string repository_instance = Repository.from_json(json) # print the JSON string representation of the object -print Repository.to_json() +print(Repository.to_json()) # convert the object into a dict repository_dict = repository_instance.to_dict() # create an instance of Repository from a dict -repository_form_dict = repository.from_dict(repository_dict) +repository_from_dict = Repository.from_dict(repository_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoryCreation.md b/clients/python/docs/RepositoryCreation.md index f63db7b4a2d..81a340a28aa 100644 --- a/clients/python/docs/RepositoryCreation.md +++ b/clients/python/docs/RepositoryCreation.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of RepositoryCreation from a JSON string repository_creation_instance = RepositoryCreation.from_json(json) # print the JSON string representation of the object -print RepositoryCreation.to_json() +print(RepositoryCreation.to_json()) # convert the object into a dict repository_creation_dict = repository_creation_instance.to_dict() # create an instance of RepositoryCreation from a dict -repository_creation_form_dict = repository_creation.from_dict(repository_creation_dict) +repository_creation_from_dict = RepositoryCreation.from_dict(repository_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoryDumpStatus.md b/clients/python/docs/RepositoryDumpStatus.md index 10955b2ec4f..6459c7d0dce 100644 --- a/clients/python/docs/RepositoryDumpStatus.md +++ b/clients/python/docs/RepositoryDumpStatus.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of RepositoryDumpStatus from a JSON string repository_dump_status_instance = RepositoryDumpStatus.from_json(json) # print the JSON string representation of the object -print RepositoryDumpStatus.to_json() +print(RepositoryDumpStatus.to_json()) # convert the object into a dict repository_dump_status_dict = repository_dump_status_instance.to_dict() # create an instance of RepositoryDumpStatus from a dict -repository_dump_status_form_dict = repository_dump_status.from_dict(repository_dump_status_dict) +repository_dump_status_from_dict = RepositoryDumpStatus.from_dict(repository_dump_status_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoryList.md b/clients/python/docs/RepositoryList.md index 78b6a87ff16..43e8e6e6e36 100644 --- a/clients/python/docs/RepositoryList.md +++ b/clients/python/docs/RepositoryList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of RepositoryList from a JSON string repository_list_instance = RepositoryList.from_json(json) # print the JSON string representation of the object -print RepositoryList.to_json() +print(RepositoryList.to_json()) # convert the object into a dict repository_list_dict = repository_list_instance.to_dict() # create an instance of RepositoryList from a dict -repository_list_form_dict = repository_list.from_dict(repository_list_dict) +repository_list_from_dict = RepositoryList.from_dict(repository_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoryMetadataKeys.md b/clients/python/docs/RepositoryMetadataKeys.md index a98926adec7..b5635ac5479 100644 --- a/clients/python/docs/RepositoryMetadataKeys.md +++ b/clients/python/docs/RepositoryMetadataKeys.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of RepositoryMetadataKeys from a JSON string repository_metadata_keys_instance = RepositoryMetadataKeys.from_json(json) # print the JSON string representation of the object -print RepositoryMetadataKeys.to_json() +print(RepositoryMetadataKeys.to_json()) # convert the object into a dict repository_metadata_keys_dict = repository_metadata_keys_instance.to_dict() # create an instance of RepositoryMetadataKeys from a dict -repository_metadata_keys_form_dict = repository_metadata_keys.from_dict(repository_metadata_keys_dict) +repository_metadata_keys_from_dict = RepositoryMetadataKeys.from_dict(repository_metadata_keys_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoryMetadataSet.md b/clients/python/docs/RepositoryMetadataSet.md index b99f360d603..aa797bcf125 100644 --- a/clients/python/docs/RepositoryMetadataSet.md +++ b/clients/python/docs/RepositoryMetadataSet.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of RepositoryMetadataSet from a JSON string repository_metadata_set_instance = RepositoryMetadataSet.from_json(json) # print the JSON string representation of the object -print RepositoryMetadataSet.to_json() +print(RepositoryMetadataSet.to_json()) # convert the object into a dict repository_metadata_set_dict = repository_metadata_set_instance.to_dict() # create an instance of RepositoryMetadataSet from a dict -repository_metadata_set_form_dict = repository_metadata_set.from_dict(repository_metadata_set_dict) +repository_metadata_set_from_dict = RepositoryMetadataSet.from_dict(repository_metadata_set_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RepositoryRestoreStatus.md b/clients/python/docs/RepositoryRestoreStatus.md index b5e23008457..f3b7851b2c9 100644 --- a/clients/python/docs/RepositoryRestoreStatus.md +++ b/clients/python/docs/RepositoryRestoreStatus.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of RepositoryRestoreStatus from a JSON string repository_restore_status_instance = RepositoryRestoreStatus.from_json(json) # print the JSON string representation of the object -print RepositoryRestoreStatus.to_json() +print(RepositoryRestoreStatus.to_json()) # convert the object into a dict repository_restore_status_dict = repository_restore_status_instance.to_dict() # create an instance of RepositoryRestoreStatus from a dict -repository_restore_status_form_dict = repository_restore_status.from_dict(repository_restore_status_dict) +repository_restore_status_from_dict = RepositoryRestoreStatus.from_dict(repository_restore_status_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/ResetCreation.md b/clients/python/docs/ResetCreation.md index 464cacaa0dd..d1e46d09899 100644 --- a/clients/python/docs/ResetCreation.md +++ b/clients/python/docs/ResetCreation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ResetCreation from a JSON string reset_creation_instance = ResetCreation.from_json(json) # print the JSON string representation of the object -print ResetCreation.to_json() +print(ResetCreation.to_json()) # convert the object into a dict reset_creation_dict = reset_creation_instance.to_dict() # create an instance of ResetCreation from a dict -reset_creation_form_dict = reset_creation.from_dict(reset_creation_dict) +reset_creation_from_dict = ResetCreation.from_dict(reset_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/RevertCreation.md b/clients/python/docs/RevertCreation.md index f267af28762..1be6110c0a0 100644 --- a/clients/python/docs/RevertCreation.md +++ b/clients/python/docs/RevertCreation.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of RevertCreation from a JSON string revert_creation_instance = RevertCreation.from_json(json) # print the JSON string representation of the object -print RevertCreation.to_json() +print(RevertCreation.to_json()) # convert the object into a dict revert_creation_dict = revert_creation_instance.to_dict() # create an instance of RevertCreation from a dict -revert_creation_form_dict = revert_creation.from_dict(revert_creation_dict) +revert_creation_from_dict = RevertCreation.from_dict(revert_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Setup.md b/clients/python/docs/Setup.md index 0b273adcbd6..1157108c593 100644 --- a/clients/python/docs/Setup.md +++ b/clients/python/docs/Setup.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of Setup from a JSON string setup_instance = Setup.from_json(json) # print the JSON string representation of the object -print Setup.to_json() +print(Setup.to_json()) # convert the object into a dict setup_dict = setup_instance.to_dict() # create an instance of Setup from a dict -setup_form_dict = setup.from_dict(setup_dict) +setup_from_dict = Setup.from_dict(setup_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/SetupState.md b/clients/python/docs/SetupState.md index fa5af29684a..32bee0447dd 100644 --- a/clients/python/docs/SetupState.md +++ b/clients/python/docs/SetupState.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of SetupState from a JSON string setup_state_instance = SetupState.from_json(json) # print the JSON string representation of the object -print SetupState.to_json() +print(SetupState.to_json()) # convert the object into a dict setup_state_dict = setup_state_instance.to_dict() # create an instance of SetupState from a dict -setup_state_form_dict = setup_state.from_dict(setup_state_dict) +setup_state_from_dict = SetupState.from_dict(setup_state_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StagingApi.md b/clients/python/docs/StagingApi.md index ae82b69ba5f..4c4a358e3c6 100644 --- a/clients/python/docs/StagingApi.md +++ b/clients/python/docs/StagingApi.md @@ -22,8 +22,6 @@ generate an address to which the client can upload an object * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.staging_location import StagingLocation from lakefs_sdk.rest import ApiException @@ -140,8 +138,6 @@ Link the physical address with the path in lakeFS, creating an uncommitted chang * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.models.staging_metadata import StagingMetadata diff --git a/clients/python/docs/StagingLocation.md b/clients/python/docs/StagingLocation.md index d66e421f8e4..e5fdbb82ef7 100644 --- a/clients/python/docs/StagingLocation.md +++ b/clients/python/docs/StagingLocation.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of StagingLocation from a JSON string staging_location_instance = StagingLocation.from_json(json) # print the JSON string representation of the object -print StagingLocation.to_json() +print(StagingLocation.to_json()) # convert the object into a dict staging_location_dict = staging_location_instance.to_dict() # create an instance of StagingLocation from a dict -staging_location_form_dict = staging_location.from_dict(staging_location_dict) +staging_location_from_dict = StagingLocation.from_dict(staging_location_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StagingMetadata.md b/clients/python/docs/StagingMetadata.md index 7e52333ff9e..892b64bb698 100644 --- a/clients/python/docs/StagingMetadata.md +++ b/clients/python/docs/StagingMetadata.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of StagingMetadata from a JSON string staging_metadata_instance = StagingMetadata.from_json(json) # print the JSON string representation of the object -print StagingMetadata.to_json() +print(StagingMetadata.to_json()) # convert the object into a dict staging_metadata_dict = staging_metadata_instance.to_dict() # create an instance of StagingMetadata from a dict -staging_metadata_form_dict = staging_metadata.from_dict(staging_metadata_dict) +staging_metadata_from_dict = StagingMetadata.from_dict(staging_metadata_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/Statement.md b/clients/python/docs/Statement.md index f83bb6514cb..d69273e0f62 100644 --- a/clients/python/docs/Statement.md +++ b/clients/python/docs/Statement.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of Statement from a JSON string statement_instance = Statement.from_json(json) # print the JSON string representation of the object -print Statement.to_json() +print(Statement.to_json()) # convert the object into a dict statement_dict = statement_instance.to_dict() # create an instance of Statement from a dict -statement_form_dict = statement.from_dict(statement_dict) +statement_from_dict = Statement.from_dict(statement_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StatsEvent.md b/clients/python/docs/StatsEvent.md index 7422705dd2e..691f776a80b 100644 --- a/clients/python/docs/StatsEvent.md +++ b/clients/python/docs/StatsEvent.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of StatsEvent from a JSON string stats_event_instance = StatsEvent.from_json(json) # print the JSON string representation of the object -print StatsEvent.to_json() +print(StatsEvent.to_json()) # convert the object into a dict stats_event_dict = stats_event_instance.to_dict() # create an instance of StatsEvent from a dict -stats_event_form_dict = stats_event.from_dict(stats_event_dict) +stats_event_from_dict = StatsEvent.from_dict(stats_event_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StatsEventsList.md b/clients/python/docs/StatsEventsList.md index 9f28b81b735..9222e477809 100644 --- a/clients/python/docs/StatsEventsList.md +++ b/clients/python/docs/StatsEventsList.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of StatsEventsList from a JSON string stats_events_list_instance = StatsEventsList.from_json(json) # print the JSON string representation of the object -print StatsEventsList.to_json() +print(StatsEventsList.to_json()) # convert the object into a dict stats_events_list_dict = stats_events_list_instance.to_dict() # create an instance of StatsEventsList from a dict -stats_events_list_form_dict = stats_events_list.from_dict(stats_events_list_dict) +stats_events_list_from_dict = StatsEventsList.from_dict(stats_events_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StorageConfig.md b/clients/python/docs/StorageConfig.md index 786ea65af02..7639ed88047 100644 --- a/clients/python/docs/StorageConfig.md +++ b/clients/python/docs/StorageConfig.md @@ -25,12 +25,12 @@ json = "{}" # create an instance of StorageConfig from a JSON string storage_config_instance = StorageConfig.from_json(json) # print the JSON string representation of the object -print StorageConfig.to_json() +print(StorageConfig.to_json()) # convert the object into a dict storage_config_dict = storage_config_instance.to_dict() # create an instance of StorageConfig from a dict -storage_config_form_dict = storage_config.from_dict(storage_config_dict) +storage_config_from_dict = StorageConfig.from_dict(storage_config_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StorageURI.md b/clients/python/docs/StorageURI.md index 70cfde9f372..f116dc6628e 100644 --- a/clients/python/docs/StorageURI.md +++ b/clients/python/docs/StorageURI.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of StorageURI from a JSON string storage_uri_instance = StorageURI.from_json(json) # print the JSON string representation of the object -print StorageURI.to_json() +print(StorageURI.to_json()) # convert the object into a dict storage_uri_dict = storage_uri_instance.to_dict() # create an instance of StorageURI from a dict -storage_uri_form_dict = storage_uri.from_dict(storage_uri_dict) +storage_uri_from_dict = StorageURI.from_dict(storage_uri_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/StsAuthRequest.md b/clients/python/docs/StsAuthRequest.md index 2ec418f8f36..9c71eaf830d 100644 --- a/clients/python/docs/StsAuthRequest.md +++ b/clients/python/docs/StsAuthRequest.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of StsAuthRequest from a JSON string sts_auth_request_instance = StsAuthRequest.from_json(json) # print the JSON string representation of the object -print StsAuthRequest.to_json() +print(StsAuthRequest.to_json()) # convert the object into a dict sts_auth_request_dict = sts_auth_request_instance.to_dict() # create an instance of StsAuthRequest from a dict -sts_auth_request_form_dict = sts_auth_request.from_dict(sts_auth_request_dict) +sts_auth_request_from_dict = StsAuthRequest.from_dict(sts_auth_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/TagCreation.md b/clients/python/docs/TagCreation.md index 4d27536e20c..f1c6138fc9c 100644 --- a/clients/python/docs/TagCreation.md +++ b/clients/python/docs/TagCreation.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of TagCreation from a JSON string tag_creation_instance = TagCreation.from_json(json) # print the JSON string representation of the object -print TagCreation.to_json() +print(TagCreation.to_json()) # convert the object into a dict tag_creation_dict = tag_creation_instance.to_dict() # create an instance of TagCreation from a dict -tag_creation_form_dict = tag_creation.from_dict(tag_creation_dict) +tag_creation_from_dict = TagCreation.from_dict(tag_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/TagsApi.md b/clients/python/docs/TagsApi.md index 8deb20e8598..3056b765e6c 100644 --- a/clients/python/docs/TagsApi.md +++ b/clients/python/docs/TagsApi.md @@ -24,8 +24,6 @@ create tag * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.ref import Ref from lakefs_sdk.models.tag_creation import TagCreation @@ -140,8 +138,6 @@ delete tag * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.rest import ApiException from pprint import pprint @@ -252,8 +248,6 @@ get tag * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.ref import Ref from lakefs_sdk.rest import ApiException @@ -364,8 +358,6 @@ list tags * Bearer (JWT) Authentication (jwt_token): ```python -import time -import os import lakefs_sdk from lakefs_sdk.models.ref_list import RefList from lakefs_sdk.rest import ApiException diff --git a/clients/python/docs/TaskInfo.md b/clients/python/docs/TaskInfo.md index d04b0c934ee..5f736882acd 100644 --- a/clients/python/docs/TaskInfo.md +++ b/clients/python/docs/TaskInfo.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of TaskInfo from a JSON string task_info_instance = TaskInfo.from_json(json) # print the JSON string representation of the object -print TaskInfo.to_json() +print(TaskInfo.to_json()) # convert the object into a dict task_info_dict = task_info_instance.to_dict() # create an instance of TaskInfo from a dict -task_info_form_dict = task_info.from_dict(task_info_dict) +task_info_from_dict = TaskInfo.from_dict(task_info_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/UnderlyingObjectProperties.md b/clients/python/docs/UnderlyingObjectProperties.md index ec3a6a48362..1fd74021a48 100644 --- a/clients/python/docs/UnderlyingObjectProperties.md +++ b/clients/python/docs/UnderlyingObjectProperties.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of UnderlyingObjectProperties from a JSON string underlying_object_properties_instance = UnderlyingObjectProperties.from_json(json) # print the JSON string representation of the object -print UnderlyingObjectProperties.to_json() +print(UnderlyingObjectProperties.to_json()) # convert the object into a dict underlying_object_properties_dict = underlying_object_properties_instance.to_dict() # create an instance of UnderlyingObjectProperties from a dict -underlying_object_properties_form_dict = underlying_object_properties.from_dict(underlying_object_properties_dict) +underlying_object_properties_from_dict = UnderlyingObjectProperties.from_dict(underlying_object_properties_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/UpdateToken.md b/clients/python/docs/UpdateToken.md index 022402064fa..2b89d5261b3 100644 --- a/clients/python/docs/UpdateToken.md +++ b/clients/python/docs/UpdateToken.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of UpdateToken from a JSON string update_token_instance = UpdateToken.from_json(json) # print the JSON string representation of the object -print UpdateToken.to_json() +print(UpdateToken.to_json()) # convert the object into a dict update_token_dict = update_token_instance.to_dict() # create an instance of UpdateToken from a dict -update_token_form_dict = update_token.from_dict(update_token_dict) +update_token_from_dict = UpdateToken.from_dict(update_token_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/UploadPart.md b/clients/python/docs/UploadPart.md index 0cef20dfc96..98ce75c280f 100644 --- a/clients/python/docs/UploadPart.md +++ b/clients/python/docs/UploadPart.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of UploadPart from a JSON string upload_part_instance = UploadPart.from_json(json) # print the JSON string representation of the object -print UploadPart.to_json() +print(UploadPart.to_json()) # convert the object into a dict upload_part_dict = upload_part_instance.to_dict() # create an instance of UploadPart from a dict -upload_part_form_dict = upload_part.from_dict(upload_part_dict) +upload_part_from_dict = UploadPart.from_dict(upload_part_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/UsageReport.md b/clients/python/docs/UsageReport.md index d4ae2df1d11..070c0a726e8 100644 --- a/clients/python/docs/UsageReport.md +++ b/clients/python/docs/UsageReport.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of UsageReport from a JSON string usage_report_instance = UsageReport.from_json(json) # print the JSON string representation of the object -print UsageReport.to_json() +print(UsageReport.to_json()) # convert the object into a dict usage_report_dict = usage_report_instance.to_dict() # create an instance of UsageReport from a dict -usage_report_form_dict = usage_report.from_dict(usage_report_dict) +usage_report_from_dict = UsageReport.from_dict(usage_report_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/User.md b/clients/python/docs/User.md index 11d24b47323..b36a9a58f60 100644 --- a/clients/python/docs/User.md +++ b/clients/python/docs/User.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of User from a JSON string user_instance = User.from_json(json) # print the JSON string representation of the object -print User.to_json() +print(User.to_json()) # convert the object into a dict user_dict = user_instance.to_dict() # create an instance of User from a dict -user_form_dict = user.from_dict(user_dict) +user_from_dict = User.from_dict(user_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/UserCreation.md b/clients/python/docs/UserCreation.md index f9bf5979017..52171be71e2 100644 --- a/clients/python/docs/UserCreation.md +++ b/clients/python/docs/UserCreation.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of UserCreation from a JSON string user_creation_instance = UserCreation.from_json(json) # print the JSON string representation of the object -print UserCreation.to_json() +print(UserCreation.to_json()) # convert the object into a dict user_creation_dict = user_creation_instance.to_dict() # create an instance of UserCreation from a dict -user_creation_form_dict = user_creation.from_dict(user_creation_dict) +user_creation_from_dict = UserCreation.from_dict(user_creation_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/UserList.md b/clients/python/docs/UserList.md index 7a68e6bc74c..b9706f275d6 100644 --- a/clients/python/docs/UserList.md +++ b/clients/python/docs/UserList.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of UserList from a JSON string user_list_instance = UserList.from_json(json) # print the JSON string representation of the object -print UserList.to_json() +print(UserList.to_json()) # convert the object into a dict user_list_dict = user_list_instance.to_dict() # create an instance of UserList from a dict -user_list_form_dict = user_list.from_dict(user_list_dict) +user_list_from_dict = UserList.from_dict(user_list_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/docs/VersionConfig.md b/clients/python/docs/VersionConfig.md index 1bcfbc96c6d..96fdd663a3b 100644 --- a/clients/python/docs/VersionConfig.md +++ b/clients/python/docs/VersionConfig.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of VersionConfig from a JSON string version_config_instance = VersionConfig.from_json(json) # print the JSON string representation of the object -print VersionConfig.to_json() +print(VersionConfig.to_json()) # convert the object into a dict version_config_dict = version_config_instance.to_dict() # create an instance of VersionConfig from a dict -version_config_form_dict = version_config.from_dict(version_config_dict) +version_config_from_dict = VersionConfig.from_dict(version_config_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/clients/python/lakefs_sdk/api/actions_api.py b/clients/python/lakefs_sdk/api/actions_api.py index c5e7dd69376..4454e0c3e99 100644 --- a/clients/python/lakefs_sdk/api/actions_api.py +++ b/clients/python/lakefs_sdk/api/actions_api.py @@ -12,205 +12,347 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictStr, conint + from pydantic.v1 import Field, StrictBytes, StrictStr except ImportError: - from pydantic import Field, StrictStr, conint - + from pydantic import Field, StrictBytes, StrictStr from typing import Optional, Union - +from typing_extensions import Annotated from lakefs_sdk.models.action_run import ActionRun from lakefs_sdk.models.action_run_list import ActionRunList from lakefs_sdk.models.hook_run_list import HookRunList -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class ActionsApi(object): +class ActionsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_run(self, repository : StrictStr, run_id : StrictStr, **kwargs) -> ActionRun: # noqa: E501 - """get a run # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_run( + self, + repository: StrictStr, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ActionRun: + """get a run - >>> thread = api.get_run(repository, run_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param run_id: (required) :type run_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ActionRun - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_run_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_run_with_http_info(repository, run_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_run_with_http_info(self, repository : StrictStr, run_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get a run # noqa: E501 + """ # noqa: E501 + + _param = self._get_run_serialize( + repository=repository, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActionRun", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_run_with_http_info( + self, + repository: StrictStr, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ActionRun]: + """get a run - >>> thread = api.get_run_with_http_info(repository, run_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param run_id: (required) :type run_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ActionRun, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_run_serialize( + repository=repository, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActionRun", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'run_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_run_without_preload_content( + self, + repository: StrictStr, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get a run + + + :param repository: (required) + :type repository: str + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_run_serialize( + repository=repository, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_run" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActionRun", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_run_serialize( + self, + repository, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['run_id']: - _path_params['run_id'] = _params['run_id'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if run_id is not None: + _path_params['run_id'] = run_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ActionRun", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/actions/runs/{run_id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/actions/runs/{run_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_run_hook_output(self, repository : StrictStr, run_id : StrictStr, hook_run_id : StrictStr, **kwargs) -> bytearray: # noqa: E501 - """get run hook output # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_run_hook_output(repository, run_id, hook_run_id, async_req=True) - >>> result = thread.get() + @validate_call + def get_run_hook_output( + self, + repository: StrictStr, + run_id: StrictStr, + hook_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """get run hook output + :param repository: (required) :type repository: str @@ -218,31 +360,76 @@ def get_run_hook_output(self, repository : StrictStr, run_id : StrictStr, hook_r :type run_id: str :param hook_run_id: (required) :type hook_run_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bytearray - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_run_hook_output_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_run_hook_output_with_http_info(repository, run_id, hook_run_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_run_hook_output_with_http_info(self, repository : StrictStr, run_id : StrictStr, hook_run_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get run hook output # noqa: E501 + """ # noqa: E501 + + _param = self._get_run_hook_output_serialize( + repository=repository, + run_id=run_id, + hook_run_id=hook_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_run_hook_output_with_http_info( + self, + repository: StrictStr, + run_id: StrictStr, + hook_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """get run hook output - >>> thread = api.get_run_hook_output_with_http_info(repository, run_id, hook_run_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -250,123 +437,224 @@ def get_run_hook_output_with_http_info(self, repository : StrictStr, run_id : St :type run_id: str :param hook_run_id: (required) :type hook_run_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_run_hook_output_serialize( + repository=repository, + run_id=run_id, + hook_run_id=hook_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'run_id', - 'hook_run_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_run_hook_output_without_preload_content( + self, + repository: StrictStr, + run_id: StrictStr, + hook_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get run hook output + + + :param repository: (required) + :type repository: str + :param run_id: (required) + :type run_id: str + :param hook_run_id: (required) + :type hook_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_run_hook_output_serialize( + repository=repository, + run_id=run_id, + hook_run_id=hook_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_run_hook_output" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_run_hook_output_serialize( + self, + repository, + run_id, + hook_run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['run_id']: - _path_params['run_id'] = _params['run_id'] + _host = None - if _params['hook_run_id']: - _path_params['hook_run_id'] = _params['hook_run_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if run_id is not None: + _path_params['run_id'] = run_id + if hook_run_id is not None: + _path_params['hook_run_id'] = hook_run_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream', 'application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/octet-stream', + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "bytearray", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_repository_runs(self, repository : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, branch : Optional[StrictStr] = None, commit : Optional[StrictStr] = None, **kwargs) -> ActionRunList: # noqa: E501 - """list runs # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_repository_runs(repository, after, amount, branch, commit, async_req=True) - >>> result = thread.get() + + @validate_call + def list_repository_runs( + self, + repository: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + branch: Optional[StrictStr] = None, + commit: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ActionRunList: + """list runs + :param repository: (required) :type repository: str @@ -378,31 +666,80 @@ def list_repository_runs(self, repository : StrictStr, after : Annotated[Optiona :type branch: str :param commit: :type commit: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ActionRunList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_repository_runs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_repository_runs_with_http_info(repository, after, amount, branch, commit, **kwargs) # noqa: E501 - - @validate_arguments - def list_repository_runs_with_http_info(self, repository : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, branch : Optional[StrictStr] = None, commit : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list runs # noqa: E501 + """ # noqa: E501 + + _param = self._list_repository_runs_serialize( + repository=repository, + after=after, + amount=amount, + branch=branch, + commit=commit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActionRunList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_repository_runs_with_http_info( + self, + repository: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + branch: Optional[StrictStr] = None, + commit: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ActionRunList]: + """list runs - >>> thread = api.list_repository_runs_with_http_info(repository, after, amount, branch, commit, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -414,131 +751,246 @@ def list_repository_runs_with_http_info(self, repository : StrictStr, after : An :type branch: str :param commit: :type commit: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ActionRunList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'after', - 'amount', - 'branch', - 'commit' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_repository_runs_serialize( + repository=repository, + after=after, + amount=amount, + branch=branch, + commit=commit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_repository_runs" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActionRunList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def list_repository_runs_without_preload_content( + self, + repository: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + branch: Optional[StrictStr] = None, + commit: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list runs - # process the query parameters - _query_params = [] - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + :param repository: (required) + :type repository: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param branch: + :type branch: str + :param commit: + :type commit: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_repository_runs_serialize( + repository=repository, + after=after, + amount=amount, + branch=branch, + commit=commit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ActionRunList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_repository_runs_serialize( + self, + repository, + after, + amount, + branch, + commit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params.get('branch') is not None: # noqa: E501 - _query_params.append(('branch', _params['branch'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('commit') is not None: # noqa: E501 - _query_params.append(('commit', _params['commit'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + if branch is not None: + + _query_params.append(('branch', branch)) + + if commit is not None: + + _query_params.append(('commit', commit)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ActionRunList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/actions/runs', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/actions/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_run_hooks(self, repository : StrictStr, run_id : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> HookRunList: # noqa: E501 - """list run hooks # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_run_hooks(repository, run_id, after, amount, async_req=True) - >>> result = thread.get() + @validate_call + def list_run_hooks( + self, + repository: StrictStr, + run_id: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HookRunList: + """list run hooks + :param repository: (required) :type repository: str @@ -548,31 +1000,78 @@ def list_run_hooks(self, repository : StrictStr, run_id : StrictStr, after : Ann :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: HookRunList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_run_hooks_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_run_hooks_with_http_info(repository, run_id, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_run_hooks_with_http_info(self, repository : StrictStr, run_id : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list run hooks # noqa: E501 + """ # noqa: E501 + + _param = self._list_run_hooks_serialize( + repository=repository, + run_id=run_id, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "HookRunList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_run_hooks_with_http_info( + self, + repository: StrictStr, + run_id: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HookRunList]: + """list run hooks - >>> thread = api.list_run_hooks_with_http_info(repository, run_id, after, amount, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -582,114 +1081,207 @@ def list_run_hooks_with_http_info(self, repository : StrictStr, run_id : StrictS :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(HookRunList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'run_id', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_run_hooks_serialize( + repository=repository, + run_id=run_id, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_run_hooks" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "HookRunList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def list_run_hooks_without_preload_content( + self, + repository: StrictStr, + run_id: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list run hooks + + + :param repository: (required) + :type repository: str + :param run_id: (required) + :type run_id: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_run_hooks_serialize( + repository=repository, + run_id=run_id, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['run_id']: - _path_params['run_id'] = _params['run_id'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "HookRunList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the query parameters - _query_params = [] - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + def _list_run_hooks_serialize( + self, + repository, + run_id, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "HookRunList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/actions/runs/{run_id}/hooks', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/actions/runs/{run_id}/hooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/auth_api.py b/clients/python/lakefs_sdk/api/auth_api.py index a5621dc4b4d..b53daf5285f 100644 --- a/clients/python/lakefs_sdk/api/auth_api.py +++ b/clients/python/lakefs_sdk/api/auth_api.py @@ -12,24 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictStr, conint + from pydantic.v1 import Field, StrictBool, StrictStr except ImportError: - from pydantic import Field, StrictBool, StrictStr, conint - + from pydantic import Field, StrictBool, StrictStr from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.acl import ACL from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.credentials import Credentials @@ -50,1047 +46,2018 @@ from lakefs_sdk.models.user_creation import UserCreation from lakefs_sdk.models.user_list import UserList -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class AuthApi(object): +class AuthApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_group_membership(self, group_id : StrictStr, user_id : StrictStr, **kwargs) -> None: # noqa: E501 - """add group membership # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_group_membership( + self, + group_id: StrictStr, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """add group membership - >>> thread = api.add_group_membership(group_id, user_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the add_group_membership_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.add_group_membership_with_http_info(group_id, user_id, **kwargs) # noqa: E501 - - @validate_arguments - def add_group_membership_with_http_info(self, group_id : StrictStr, user_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """add group membership # noqa: E501 + """ # noqa: E501 + + _param = self._add_group_membership_serialize( + group_id=group_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_group_membership_with_http_info( + self, + group_id: StrictStr, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """add group membership - >>> thread = api.add_group_membership_with_http_info(group_id, user_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._add_group_membership_serialize( + group_id=group_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'group_id', - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def add_group_membership_without_preload_content( + self, + group_id: StrictStr, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """add group membership + + + :param group_id: (required) + :type group_id: str + :param user_id: (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_group_membership_serialize( + group_id=group_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_group_membership" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _add_group_membership_serialize( + self, + group_id, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + if user_id is not None: + _path_params['userId'] = user_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/members/{userId}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/auth/groups/{groupId}/members/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def attach_policy_to_group(self, group_id : StrictStr, policy_id : StrictStr, **kwargs) -> None: # noqa: E501 - """attach policy to group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.attach_policy_to_group(group_id, policy_id, async_req=True) - >>> result = thread.get() + @validate_call + def attach_policy_to_group( + self, + group_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """attach policy to group + :param group_id: (required) :type group_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the attach_policy_to_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.attach_policy_to_group_with_http_info(group_id, policy_id, **kwargs) # noqa: E501 - - @validate_arguments - def attach_policy_to_group_with_http_info(self, group_id : StrictStr, policy_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """attach policy to group # noqa: E501 + """ # noqa: E501 + + _param = self._attach_policy_to_group_serialize( + group_id=group_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def attach_policy_to_group_with_http_info( + self, + group_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """attach policy to group - >>> thread = api.attach_policy_to_group_with_http_info(group_id, policy_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._attach_policy_to_group_serialize( + group_id=group_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'group_id', - 'policy_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def attach_policy_to_group_without_preload_content( + self, + group_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """attach policy to group + + + :param group_id: (required) + :type group_id: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attach_policy_to_group_serialize( + group_id=group_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method attach_policy_to_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _attach_policy_to_group_serialize( + self, + group_id, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/policies/{policyId}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/auth/groups/{groupId}/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def attach_policy_to_user(self, user_id : StrictStr, policy_id : StrictStr, **kwargs) -> None: # noqa: E501 - """attach policy to user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.attach_policy_to_user(user_id, policy_id, async_req=True) - >>> result = thread.get() + @validate_call + def attach_policy_to_user( + self, + user_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """attach policy to user + :param user_id: (required) :type user_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the attach_policy_to_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.attach_policy_to_user_with_http_info(user_id, policy_id, **kwargs) # noqa: E501 - - @validate_arguments - def attach_policy_to_user_with_http_info(self, user_id : StrictStr, policy_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """attach policy to user # noqa: E501 + """ # noqa: E501 + + _param = self._attach_policy_to_user_serialize( + user_id=user_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def attach_policy_to_user_with_http_info( + self, + user_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """attach policy to user - >>> thread = api.attach_policy_to_user_with_http_info(user_id, policy_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._attach_policy_to_user_serialize( + user_id=user_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id', - 'policy_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def attach_policy_to_user_without_preload_content( + self, + user_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """attach policy to user + + + :param user_id: (required) + :type user_id: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attach_policy_to_user_serialize( + user_id=user_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method attach_policy_to_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _attach_policy_to_user_serialize( + self, + user_id, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/policies/{policyId}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/auth/users/{userId}/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_credentials(self, user_id : StrictStr, **kwargs) -> CredentialsWithSecret: # noqa: E501 - """create credentials # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_credentials(user_id, async_req=True) - >>> result = thread.get() + @validate_call + def create_credentials( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CredentialsWithSecret: + """create credentials + :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CredentialsWithSecret - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_credentials_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_credentials_with_http_info(user_id, **kwargs) # noqa: E501 - - @validate_arguments - def create_credentials_with_http_info(self, user_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """create credentials # noqa: E501 + """ # noqa: E501 + + _param = self._create_credentials_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "CredentialsWithSecret", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_credentials_with_http_info( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CredentialsWithSecret]: + """create credentials - >>> thread = api.create_credentials_with_http_info(user_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CredentialsWithSecret, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_credentials_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CredentialsWithSecret", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_credentials_without_preload_content( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create credentials + + + :param user_id: (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_credentials_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_credentials" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "CredentialsWithSecret", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _create_credentials_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '201': "CredentialsWithSecret", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/credentials', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/users/{userId}/credentials', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def create_group(self, group_creation : Optional[GroupCreation] = None, **kwargs) -> Group: # noqa: E501 - """create group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_group( + self, + group_creation: Optional[GroupCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """create group - >>> thread = api.create_group(group_creation, async_req=True) - >>> result = thread.get() :param group_creation: :type group_creation: GroupCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Group - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_group_with_http_info(group_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_group_with_http_info(self, group_creation : Optional[GroupCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """create group # noqa: E501 + """ # noqa: E501 + + _param = self._create_group_serialize( + group_creation=group_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "Group", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_group_with_http_info( + self, + group_creation: Optional[GroupCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: + """create group - >>> thread = api.create_group_with_http_info(group_creation, async_req=True) - >>> result = thread.get() :param group_creation: :type group_creation: GroupCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Group, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._create_group_serialize( + group_creation=group_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'group_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Group", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def create_group_without_preload_content( + self, + group_creation: Optional[GroupCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create group - # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] + :param group_creation: + :type group_creation: GroupCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_group_serialize( + group_creation=group_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Group", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_group_serialize( + self, + group_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['group_creation'] is not None: - _body_params = _params['group_creation'] + if group_creation is not None: + _body_params = group_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "Group", - '401': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_policy(self, policy : Policy, **kwargs) -> Policy: # noqa: E501 - """create policy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_policy(policy, async_req=True) - >>> result = thread.get() + @validate_call + def create_policy( + self, + policy: Policy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Policy: + """create policy + :param policy: (required) :type policy: Policy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Policy - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_policy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_policy_with_http_info(policy, **kwargs) # noqa: E501 - - @validate_arguments - def create_policy_with_http_info(self, policy : Policy, **kwargs) -> ApiResponse: # noqa: E501 - """create policy # noqa: E501 + """ # noqa: E501 + + _param = self._create_policy_serialize( + policy=policy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "Policy", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_policy_with_http_info( + self, + policy: Policy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Policy]: + """create policy - >>> thread = api.create_policy_with_http_info(policy, async_req=True) - >>> result = thread.get() :param policy: (required) :type policy: Policy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Policy, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_policy_serialize( + policy=policy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Policy", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'policy' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_policy_without_preload_content( + self, + policy: Policy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create policy + + + :param policy: (required) + :type policy: Policy + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_policy_serialize( + policy=policy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_policy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Policy", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _create_policy_serialize( + self, + policy, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['policy'] is not None: - _body_params = _params['policy'] + if policy is not None: + _body_params = policy + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "Policy", - '400': "Error", - '401': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/policies', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/policies', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def create_user(self, user_creation : Optional[UserCreation] = None, **kwargs) -> User: # noqa: E501 - """create user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_user( + self, + user_creation: Optional[UserCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """create user - >>> thread = api.create_user(user_creation, async_req=True) - >>> result = thread.get() :param user_creation: :type user_creation: UserCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_user_with_http_info(user_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_user_with_http_info(self, user_creation : Optional[UserCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """create user # noqa: E501 + """ # noqa: E501 + + _param = self._create_user_serialize( + user_creation=user_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "User", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_user_with_http_info( + self, + user_creation: Optional[UserCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """create user - >>> thread = api.create_user_with_http_info(user_creation, async_req=True) - >>> result = thread.get() :param user_creation: :type user_creation: UserCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_user_serialize( + user_creation=user_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "User", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_user_without_preload_content( + self, + user_creation: Optional[UserCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create user + + + :param user_creation: + :type user_creation: UserCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_creation=user_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "User", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _create_user_serialize( + self, + user_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user_creation'] is not None: - _body_params = _params['user_creation'] + if user_creation is not None: + _body_params = user_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "User", - '400': "Error", - '401': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> None: # noqa: E501 - """attach external principal to user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) - >>> result = thread.get() + @validate_call + def create_user_external_principal( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """attach external principal to user + :param user_id: (required) :type user_id: str @@ -1098,31 +2065,77 @@ def create_user_external_principal(self, user_id : StrictStr, principal_id : Str :type principal_id: str :param external_principal_creation: :type external_principal_creation: ExternalPrincipalCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """attach external principal to user # noqa: E501 + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_user_external_principal_with_http_info( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """attach external principal to user - >>> thread = api.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -1130,2534 +2143,4627 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri :type principal_id: str :param external_principal_creation: :type external_principal_creation: ExternalPrincipalCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'user_id', - 'principal_id', - 'external_principal_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_user_external_principal_without_preload_content( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """attach external principal to user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _create_user_external_principal_serialize( + self, + user_id, + principal_id, + external_principal_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['external_principal_creation'] is not None: - _body_params = _params['external_principal_creation'] + if external_principal_creation is not None: + _body_params = external_principal_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/users/{userId}/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_credentials(self, user_id : StrictStr, access_key_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete credentials # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_credentials(user_id, access_key_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_credentials( + self, + user_id: StrictStr, + access_key_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete credentials + :param user_id: (required) :type user_id: str :param access_key_id: (required) :type access_key_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_credentials_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_credentials_with_http_info(user_id, access_key_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_credentials_with_http_info(self, user_id : StrictStr, access_key_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete credentials # noqa: E501 + """ # noqa: E501 + + _param = self._delete_credentials_serialize( + user_id=user_id, + access_key_id=access_key_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_credentials_with_http_info( + self, + user_id: StrictStr, + access_key_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete credentials - >>> thread = api.delete_credentials_with_http_info(user_id, access_key_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param access_key_id: (required) :type access_key_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'access_key_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_credentials_serialize( + user_id=user_id, + access_key_id=access_key_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_credentials" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] - if _params['access_key_id']: - _path_params['accessKeyId'] = _params['access_key_id'] + @validate_call + def delete_credentials_without_preload_content( + self, + user_id: StrictStr, + access_key_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete credentials + :param user_id: (required) + :type user_id: str + :param access_key_id: (required) + :type access_key_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_credentials_serialize( + user_id=user_id, + access_key_id=access_key_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_credentials_serialize( + self, + user_id, + access_key_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + if access_key_id is not None: + _path_params['accessKeyId'] = access_key_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/credentials/{accessKeyId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/users/{userId}/credentials/{accessKeyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_group(self, group_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_group(group_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_group( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete group + :param group_id: (required) :type group_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_group_with_http_info(group_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_group_with_http_info(self, group_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete group # noqa: E501 + """ # noqa: E501 + + _param = self._delete_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_group_with_http_info( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete group - >>> thread = api.delete_group_with_http_info(group_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'group_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_group_without_preload_content( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete group + + + :param group_id: (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _delete_group_serialize( + self, + group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/groups/{groupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_group_membership(self, group_id : StrictStr, user_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete group membership # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_group_membership( + self, + group_id: StrictStr, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete group membership - >>> thread = api.delete_group_membership(group_id, user_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_group_membership_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_group_membership_with_http_info(group_id, user_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_group_membership_with_http_info(self, group_id : StrictStr, user_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete group membership # noqa: E501 + """ # noqa: E501 + + _param = self._delete_group_membership_serialize( + group_id=group_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_group_membership_with_http_info( + self, + group_id: StrictStr, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete group membership - >>> thread = api.delete_group_membership_with_http_info(group_id, user_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_group_membership_serialize( + group_id=group_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'group_id', - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_group_membership_without_preload_content( + self, + group_id: StrictStr, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete group membership + + + :param group_id: (required) + :type group_id: str + :param user_id: (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_group_membership_serialize( + group_id=group_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_group_membership" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _delete_group_membership_serialize( + self, + group_id, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + if user_id is not None: + _path_params['userId'] = user_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/members/{userId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/groups/{groupId}/members/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_policy(self, policy_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete policy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_policy(policy_id, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_policy( + self, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete policy + :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_policy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_policy_with_http_info(policy_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_policy_with_http_info(self, policy_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete policy # noqa: E501 + """ # noqa: E501 + + _param = self._delete_policy_serialize( + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_policy_with_http_info( + self, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete policy - >>> thread = api.delete_policy_with_http_info(policy_id, async_req=True) - >>> result = thread.get() :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_policy_serialize( + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'policy_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_policy_without_preload_content( + self, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete policy + + + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_policy_serialize( + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_policy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + def _delete_policy_serialize( + self, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/policies/{policyId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_user(self, user_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user(user_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_user( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete user + :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_user_with_http_info(user_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_user_with_http_info(self, user_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete user # noqa: E501 + """ # noqa: E501 + + _param = self._delete_user_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_user_with_http_info( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete user - >>> thread = api.delete_user_with_http_info(user_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_user_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_user_without_preload_content( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete user + + + :param user_id: (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _delete_user_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/users/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete external principal from user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_user_external_principal( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete external principal from user - >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_user_external_principal_with_http_info(user_id, principal_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete external principal from user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user_external_principal_with_http_info(user_id, principal_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - :param user_id: (required) + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_user_external_principal_with_http_info( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete external principal from user + + + :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id', - 'principal_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_user_external_principal_without_preload_content( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete external principal from user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _delete_user_external_principal_serialize( + self, + user_id, + principal_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/users/{userId}/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def detach_policy_from_group(self, group_id : StrictStr, policy_id : StrictStr, **kwargs) -> None: # noqa: E501 - """detach policy from group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.detach_policy_from_group(group_id, policy_id, async_req=True) - >>> result = thread.get() + + @validate_call + def detach_policy_from_group( + self, + group_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """detach policy from group + :param group_id: (required) :type group_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the detach_policy_from_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.detach_policy_from_group_with_http_info(group_id, policy_id, **kwargs) # noqa: E501 - - @validate_arguments - def detach_policy_from_group_with_http_info(self, group_id : StrictStr, policy_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """detach policy from group # noqa: E501 + """ # noqa: E501 + + _param = self._detach_policy_from_group_serialize( + group_id=group_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def detach_policy_from_group_with_http_info( + self, + group_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """detach policy from group - >>> thread = api.detach_policy_from_group_with_http_info(group_id, policy_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._detach_policy_from_group_serialize( + group_id=group_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'group_id', - 'policy_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def detach_policy_from_group_without_preload_content( + self, + group_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """detach policy from group + + + :param group_id: (required) + :type group_id: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._detach_policy_from_group_serialize( + group_id=group_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method detach_policy_from_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _detach_policy_from_group_serialize( + self, + group_id, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/policies/{policyId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/groups/{groupId}/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def detach_policy_from_user(self, user_id : StrictStr, policy_id : StrictStr, **kwargs) -> None: # noqa: E501 - """detach policy from user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def detach_policy_from_user( + self, + user_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """detach policy from user - >>> thread = api.detach_policy_from_user(user_id, policy_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the detach_policy_from_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.detach_policy_from_user_with_http_info(user_id, policy_id, **kwargs) # noqa: E501 - - @validate_arguments - def detach_policy_from_user_with_http_info(self, user_id : StrictStr, policy_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """detach policy from user # noqa: E501 + """ # noqa: E501 + + _param = self._detach_policy_from_user_serialize( + user_id=user_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def detach_policy_from_user_with_http_info( + self, + user_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """detach policy from user - >>> thread = api.detach_policy_from_user_with_http_info(user_id, policy_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param policy_id: (required) :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._detach_policy_from_user_serialize( + user_id=user_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id', - 'policy_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def detach_policy_from_user_without_preload_content( + self, + user_id: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """detach policy from user + + + :param user_id: (required) + :type user_id: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._detach_policy_from_user_serialize( + user_id=user_id, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method detach_policy_from_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _detach_policy_from_user_serialize( + self, + user_id, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/policies/{policyId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/users/{userId}/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def external_principal_login(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> AuthenticationToken: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.external_principal_login(external_login_information, async_req=True) - >>> result = thread.get() + + @validate_call + def external_principal_login( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthenticationToken: + """perform a login using an external authenticator + :param external_login_information: :type external_login_information: ExternalLoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthenticationToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 - - @validate_arguments - def external_principal_login_with_http_info(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def external_principal_login_with_http_info( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthenticationToken]: + """perform a login using an external authenticator - >>> thread = api.external_principal_login_with_http_info(external_login_information, async_req=True) - >>> result = thread.get() :param external_login_information: :type external_login_information: ExternalLoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'external_login_information' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def external_principal_login_without_preload_content( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """perform a login using an external authenticator + + + :param external_login_information: + :type external_login_information: ExternalLoginInformation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method external_principal_login" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _external_principal_login_serialize( + self, + external_login_information, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['external_login_information'] is not None: - _body_params = _params['external_login_information'] + if external_login_information is not None: + _body_params = external_login_information + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "AuthenticationToken", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/auth/external/principal/login', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/external/principal/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_credentials(self, user_id : StrictStr, access_key_id : StrictStr, **kwargs) -> Credentials: # noqa: E501 - """get credentials # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_credentials(user_id, access_key_id, async_req=True) - >>> result = thread.get() + @validate_call + def get_credentials( + self, + user_id: StrictStr, + access_key_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Credentials: + """get credentials + :param user_id: (required) :type user_id: str :param access_key_id: (required) :type access_key_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Credentials - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_credentials_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_credentials_with_http_info(user_id, access_key_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_credentials_with_http_info(self, user_id : StrictStr, access_key_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get credentials # noqa: E501 + """ # noqa: E501 + + _param = self._get_credentials_serialize( + user_id=user_id, + access_key_id=access_key_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "Credentials", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_credentials_with_http_info( + self, + user_id: StrictStr, + access_key_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Credentials]: + """get credentials - >>> thread = api.get_credentials_with_http_info(user_id, access_key_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param access_key_id: (required) :type access_key_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Credentials, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._get_credentials_serialize( + user_id=user_id, + access_key_id=access_key_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'user_id', - 'access_key_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Credentials", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_credentials" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def get_credentials_without_preload_content( + self, + user_id: StrictStr, + access_key_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get credentials - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] - if _params['access_key_id']: - _path_params['accessKeyId'] = _params['access_key_id'] + :param user_id: (required) + :type user_id: str + :param access_key_id: (required) + :type access_key_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_credentials_serialize( + user_id=user_id, + access_key_id=access_key_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Credentials", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_credentials_serialize( + self, + user_id, + access_key_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + if access_key_id is not None: + _path_params['accessKeyId'] = access_key_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Credentials", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/credentials/{accessKeyId}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/credentials/{accessKeyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_current_user(self, **kwargs) -> CurrentUser: # noqa: E501 - """get current user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_current_user(async_req=True) - >>> result = thread.get() + @validate_call + def get_current_user( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CurrentUser: + """get current user + - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CurrentUser - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_current_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_current_user_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_current_user_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get current user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_current_user_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CurrentUser", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_current_user_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CurrentUser]: + """get current user + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CurrentUser, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "CurrentUser", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_current_user_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get current user + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_current_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CurrentUser", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_current_user_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "CurrentUser", - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/user', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_external_principal(self, principal_id : StrictStr, **kwargs) -> ExternalPrincipal: # noqa: E501 - """describe external principal by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_principal(principal_id, async_req=True) - >>> result = thread.get() + + @validate_call + def get_external_principal( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExternalPrincipal: + """describe external principal by id + :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ExternalPrincipal - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_external_principal_with_http_info(principal_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """describe external principal by id # noqa: E501 + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_external_principal_with_http_info( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExternalPrincipal]: + """describe external principal by id - >>> thread = api.get_external_principal_with_http_info(principal_id, async_req=True) - >>> result = thread.get() :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ExternalPrincipal, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'principal_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_external_principal_without_preload_content( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """describe external principal by id + + + :param principal_id: (required) + :type principal_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_external_principal_serialize( + self, + principal_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ExternalPrincipal", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/external/principals', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def get_group(self, group_id : StrictStr, **kwargs) -> Group: # noqa: E501 - """get group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.get_group(group_id, async_req=True) - >>> result = thread.get() - :param group_id: (required) - :type group_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Group - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_group_with_http_info(group_id, **kwargs) # noqa: E501 - @validate_arguments - def get_group_with_http_info(self, group_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_group( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """get group - >>> thread = api.get_group_with_http_info(group_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Group, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'group_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_group" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "Group", '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/auth/groups/{groupId}', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def get_group_acl(self, group_id : StrictStr, **kwargs) -> ACL: # noqa: E501 - """get ACL of group # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def get_group_with_http_info( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: + """get group - >>> thread = api.get_group_acl(group_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ACL - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_group_acl_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_group_acl_with_http_info(group_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def get_group_acl_with_http_info(self, group_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get ACL of group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_group_without_preload_content( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get group - >>> thread = api.get_group_acl_with_http_info(group_id, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ACL, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._get_group_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'group_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Group", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_group_acl" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _get_group_serialize( + self, + group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ACL", - '401': "Error", - '404': "ErrorNoACL", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/acl', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/groups/{groupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_policy(self, policy_id : StrictStr, **kwargs) -> Policy: # noqa: E501 - """get policy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_policy(policy_id, async_req=True) - >>> result = thread.get() - :param policy_id: (required) - :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def get_group_acl( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ACL: + """get ACL of group + + + :param group_id: (required) + :type group_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Policy - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_policy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_policy_with_http_info(policy_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_policy_with_http_info(self, policy_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get policy # noqa: E501 + """ # noqa: E501 + + _param = self._get_group_acl_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ACL", + '401': "Error", + '404': "ErrorNoACL", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_group_acl_with_http_info( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ACL]: + """get ACL of group - >>> thread = api.get_policy_with_http_info(policy_id, async_req=True) - >>> result = thread.get() - :param policy_id: (required) - :type policy_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param group_id: (required) + :type group_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Policy, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_group_acl_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ACL", + '401': "Error", + '404': "ErrorNoACL", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'policy_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_group_acl_without_preload_content( + self, + group_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get ACL of group + + + :param group_id: (required) + :type group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_acl_serialize( + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_policy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ACL", + '401': "Error", + '404': "ErrorNoACL", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + def _get_group_acl_serialize( + self, + group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Policy", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/policies/{policyId}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/groups/{groupId}/acl', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_user(self, user_id : StrictStr, **kwargs) -> User: # noqa: E501 - """get user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user(user_id, async_req=True) - >>> result = thread.get() - :param user_id: (required) - :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def get_policy( + self, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Policy: + """get policy + + + :param policy_id: (required) + :type policy_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_user_with_http_info(user_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_user_with_http_info(self, user_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get user # noqa: E501 + """ # noqa: E501 + + _param = self._get_policy_serialize( + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "Policy", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_policy_with_http_info( + self, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Policy]: + """get policy - >>> thread = api.get_user_with_http_info(user_id, async_req=True) - >>> result = thread.get() - :param user_id: (required) - :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param policy_id: (required) + :type policy_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_policy_serialize( + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Policy", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_policy_without_preload_content( + self, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get policy + + + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_policy_serialize( + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Policy", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _get_policy_serialize( + self, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "User", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_group_members(self, group_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> UserList: # noqa: E501 - """list group members # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_group_members(group_id, prefix, after, amount, async_req=True) - >>> result = thread.get() - :param group_id: (required) - :type group_id: str - :param prefix: return items prefixed with this value - :type prefix: str - :param after: return items after this value - :type after: str - :param amount: how many items to return - :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def get_user( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """get user + + + :param user_id: (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_user_with_http_info( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """get user + + + :param user_id: (required) + :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_group_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_group_members_with_http_info(group_id, prefix, after, amount, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._get_user_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def list_group_members_with_http_info(self, group_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list group members # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_user_without_preload_content( + self, + user_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get user - >>> thread = api.list_group_members_with_http_info(group_id, prefix, after, amount, async_req=True) - >>> result = thread.get() - :param group_id: (required) - :type group_id: str - :param prefix: return items prefixed with this value - :type prefix: str - :param after: return items after this value - :type after: str - :param amount: how many items to return - :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param user_id: (required) + :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'group_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_user_serialize( + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_group_members" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _get_user_serialize( + self, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _host = None - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "UserList", - '401': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/members', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_group_policies(self, group_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> PolicyList: # noqa: E501 - """list group policies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_group_policies(group_id, prefix, after, amount, async_req=True) - >>> result = thread.get() + @validate_call + def list_group_members( + self, + group_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserList: + """list group members + :param group_id: (required) :type group_id: str @@ -3667,31 +6773,77 @@ def list_group_policies(self, group_id : StrictStr, prefix : Annotated[Optional[ :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PolicyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_group_policies_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_group_policies_with_http_info(group_id, prefix, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_group_policies_with_http_info(self, group_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list group policies # noqa: E501 + """ # noqa: E501 + + _param = self._list_group_members_serialize( + group_id=group_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_group_members_with_http_info( + self, + group_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserList]: + """list group members - >>> thread = api.list_group_policies_with_http_info(group_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str @@ -3701,437 +6853,1879 @@ def list_group_policies_with_http_info(self, group_id : StrictStr, prefix : Anno :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PolicyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'group_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_group_members_serialize( + group_id=group_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_group_policies" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + @validate_call + def list_group_members_without_preload_content( + self, + group_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list group members - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + :param group_id: (required) + :type group_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_members_serialize( + group_id=group_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_group_members_serialize( + self, + group_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/groups/{groupId}/members', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_group_policies( + self, + group_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PolicyList: + """list group policies + + + :param group_id: (required) + :type group_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_policies_serialize( + group_id=group_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_group_policies_with_http_info( + self, + group_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PolicyList]: + """list group policies + + + :param group_id: (required) + :type group_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_policies_serialize( + group_id=group_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_group_policies_without_preload_content( + self, + group_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list group policies + + + :param group_id: (required) + :type group_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_policies_serialize( + group_id=group_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_group_policies_serialize( + self, + group_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/groups/{groupId}/policies', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_groups( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupList: + """list groups + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_groups_with_http_info( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupList]: + """list groups + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_groups_without_preload_content( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list groups + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_groups_serialize( + self, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_policies( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PolicyList: + """list policies + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_policies_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_policies_with_http_info( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PolicyList]: + """list policies + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_policies_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_policies_without_preload_content( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list policies + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_policies_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_policies_serialize( + self, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/policies', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_user_credentials( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CredentialsList: + """list user credentials + + + :param user_id: (required) + :type user_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_user_credentials_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialsList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_user_credentials_with_http_info( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CredentialsList]: + """list user credentials + + + :param user_id: (required) + :type user_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_user_credentials_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialsList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_user_credentials_without_preload_content( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list user credentials + + + :param user_id: (required) + :type user_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_user_credentials_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialsList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_user_credentials_serialize( + self, + user_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/credentials', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_user_external_principals( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExternalPrincipalList: + """list user external policies attached to a user + + + :param user_id: (required) + :type user_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { - '200': "PolicyList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/auth/groups/{groupId}/policies', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_groups(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> GroupList: # noqa: E501 - """list groups # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def list_user_external_principals_with_http_info( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExternalPrincipalList]: + """list user external policies attached to a user - >>> thread = api.list_groups(prefix, after, amount, async_req=True) - >>> result = thread.get() + :param user_id: (required) + :type user_id: str :param prefix: return items prefixed with this value :type prefix: str :param after: return items after this value :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GroupList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_groups_with_http_info(prefix, after, amount, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def list_groups_with_http_info(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list groups # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_user_external_principals_without_preload_content( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list user external policies attached to a user - >>> thread = api.list_groups_with_http_info(prefix, after, amount, async_req=True) - >>> result = thread.get() + :param user_id: (required) + :type user_id: str :param prefix: return items prefixed with this value :type prefix: str :param after: return items after this value :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GroupList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_groups" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _list_user_external_principals_serialize( + self, + user_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _host = None - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "GroupList", - '401': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/external/principals/ls', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_policies(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> PolicyList: # noqa: E501 - """list policies # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.list_policies(prefix, after, amount, async_req=True) - >>> result = thread.get() - :param prefix: return items prefixed with this value - :type prefix: str - :param after: return items after this value - :type after: str - :param amount: how many items to return - :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PolicyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_policies_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_policies_with_http_info(prefix, after, amount, **kwargs) # noqa: E501 - @validate_arguments - def list_policies_with_http_info(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list policies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_user_groups( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupList: + """list user groups - >>> thread = api.list_policies_with_http_info(prefix, after, amount, async_req=True) - >>> result = thread.get() + :param user_id: (required) + :type user_id: str :param prefix: return items prefixed with this value :type prefix: str :param after: return items after this value :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PolicyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_groups_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_policies" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) - - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "PolicyList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupList", '401': "Error", + '404': "Error", '420': None, } - - return self.api_client.call_api( - '/auth/policies', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_user_credentials(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> CredentialsList: # noqa: E501 - """list user credentials # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def list_user_groups_with_http_info( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupList]: + """list user groups - >>> thread = api.list_user_credentials(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -4141,31 +8735,78 @@ def list_user_credentials(self, user_id : StrictStr, prefix : Annotated[Optional :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CredentialsList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_user_credentials_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_user_credentials_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._list_user_groups_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def list_user_credentials_with_http_info(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list user credentials # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_user_groups_without_preload_content( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list user groups - >>> thread = api.list_user_credentials_with_http_info(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -4175,161 +8816,156 @@ def list_user_credentials_with_http_info(self, user_id : StrictStr, prefix : Ann :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CredentialsList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_groups_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_user_credentials" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _list_user_groups_serialize( + self, + user_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _host = None - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "CredentialsList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/credentials', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_user_external_principals(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ExternalPrincipalList: # noqa: E501 - """list user external policies attached to a user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.list_user_external_principals(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() - :param user_id: (required) - :type user_id: str - :param prefix: return items prefixed with this value - :type prefix: str - :param after: return items after this value - :type after: str - :param amount: how many items to return - :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ExternalPrincipalList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_user_external_principals_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_user_external_principals_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 - @validate_arguments - def list_user_external_principals_with_http_info(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list user external policies attached to a user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_user_policies( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + effective: Annotated[Optional[StrictBool], Field(description="will return all distinct policies attached to the user or any of its groups")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PolicyList: + """list user policies - >>> thread = api.list_user_external_principals_with_http_info(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -4339,127 +8975,82 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param effective: will return all distinct policies attached to the user or any of its groups + :type effective: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ExternalPrincipalList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_policies_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + effective=effective, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_user_external_principals" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] - - - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) - - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "ExternalPrincipalList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/auth/users/{userId}/external/principals/ls', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_user_groups(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> GroupList: # noqa: E501 - """list user groups # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def list_user_policies_with_http_info( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + effective: Annotated[Optional[StrictBool], Field(description="will return all distinct policies attached to the user or any of its groups")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PolicyList]: + """list user policies - >>> thread = api.list_user_groups(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -4469,31 +9060,82 @@ def list_user_groups(self, user_id : StrictStr, prefix : Annotated[Optional[Stri :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param effective: will return all distinct policies attached to the user or any of its groups + :type effective: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GroupList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_user_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_user_groups_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._list_user_policies_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + effective=effective, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def list_user_groups_with_http_info(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list user groups # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_user_policies_without_preload_content( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + effective: Annotated[Optional[StrictBool], Field(description="will return all distinct policies attached to the user or any of its groups")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list user policies - >>> thread = api.list_user_groups_with_http_info(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -4503,299 +9145,238 @@ def list_user_groups_with_http_info(self, user_id : StrictStr, prefix : Annotate :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param effective: will return all distinct policies attached to the user or any of its groups + :type effective: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GroupList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_policies_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + effective=effective, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_user_groups" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "PolicyList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _list_user_policies_serialize( + self, + user_id, + prefix, + after, + amount, + effective, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _host = None - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + if effective is not None: + + _query_params.append(('effective', effective)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "GroupList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/groups', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/policies', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_user_policies(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, effective : Annotated[Optional[StrictBool], Field(description="will return all distinct policies attached to the user or any of its groups")] = None, **kwargs) -> PolicyList: # noqa: E501 - """list user policies # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_user_policies(user_id, prefix, after, amount, effective, async_req=True) - >>> result = thread.get() + _host=_host, + _request_auth=_request_auth + ) - :param user_id: (required) - :type user_id: str - :param prefix: return items prefixed with this value - :type prefix: str - :param after: return items after this value - :type after: str - :param amount: how many items to return - :type amount: int - :param effective: will return all distinct policies attached to the user or any of its groups - :type effective: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PolicyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_user_policies_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_user_policies_with_http_info(user_id, prefix, after, amount, effective, **kwargs) # noqa: E501 - @validate_arguments - def list_user_policies_with_http_info(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, effective : Annotated[Optional[StrictBool], Field(description="will return all distinct policies attached to the user or any of its groups")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list user policies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_user_policies_with_http_info(user_id, prefix, after, amount, effective, async_req=True) - >>> result = thread.get() + @validate_call + def list_users( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserList: + """list users + - :param user_id: (required) - :type user_id: str :param prefix: return items prefixed with this value :type prefix: str :param after: return items after this value :type after: str :param amount: how many items to return :type amount: int - :param effective: will return all distinct policies attached to the user or any of its groups - :type effective: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PolicyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'prefix', - 'after', - 'amount', - 'effective' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_users_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_user_policies" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] - - - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) - - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) - - if _params.get('effective') is not None: # noqa: E501 - _query_params.append(('effective', _params['effective'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "PolicyList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", '401': "Error", - '404': "Error", '420': None, } - - return self.api_client.call_api( - '/auth/users/{userId}/policies', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_users(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> UserList: # noqa: E501 - """list users # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def list_users_with_http_info( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserList]: + """list users - >>> thread = api.list_users(prefix, after, amount, async_req=True) - >>> result = thread.get() :param prefix: return items prefixed with this value :type prefix: str @@ -4803,31 +9384,75 @@ def list_users(self, prefix : Annotated[Optional[StrictStr], Field(description=" :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_users_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_users_with_http_info(prefix, after, amount, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._list_users_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def list_users_with_http_info(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list users # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_users_without_preload_content( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list users - >>> thread = api.list_users_with_http_info(prefix, after, amount, async_req=True) - >>> result = thread.get() :param prefix: return items prefixed with this value :type prefix: str @@ -4835,561 +9460,994 @@ def list_users_with_http_info(self, prefix : Annotated[Optional[StrictStr], Fiel :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_users_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_users" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _list_users_serialize( + self, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _host = None - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "UserList", - '401': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def login(self, login_information : Optional[LoginInformation] = None, **kwargs) -> AuthenticationToken: # noqa: E501 - """perform a login # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login(login_information, async_req=True) - >>> result = thread.get() + @validate_call + def login( + self, + login_information: Optional[LoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthenticationToken: + """perform a login + :param login_information: :type login_information: LoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthenticationToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.login_with_http_info(login_information, **kwargs) # noqa: E501 - - @validate_arguments - def login_with_http_info(self, login_information : Optional[LoginInformation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """perform a login # noqa: E501 + """ # noqa: E501 + + _param = self._login_serialize( + login_information=login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def login_with_http_info( + self, + login_information: Optional[LoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthenticationToken]: + """perform a login - >>> thread = api.login_with_http_info(login_information, async_req=True) - >>> result = thread.get() :param login_information: :type login_information: LoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._login_serialize( + login_information=login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'login_information' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def login_without_preload_content( + self, + login_information: Optional[LoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """perform a login + + + :param login_information: + :type login_information: LoginInformation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._login_serialize( + login_information=login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method login" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _login_serialize( + self, + login_information, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['login_information'] is not None: - _body_params = _params['login_information'] + if login_information is not None: + _body_params = login_information + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "AuthenticationToken", - '401': "Error", - '420': None, - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/auth/login', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def set_group_acl(self, group_id : StrictStr, acl : ACL, **kwargs) -> None: # noqa: E501 - """set ACL of group # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def set_group_acl( + self, + group_id: StrictStr, + acl: ACL, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """set ACL of group - >>> thread = api.set_group_acl(group_id, acl, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param acl: (required) :type acl: ACL - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the set_group_acl_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.set_group_acl_with_http_info(group_id, acl, **kwargs) # noqa: E501 - - @validate_arguments - def set_group_acl_with_http_info(self, group_id : StrictStr, acl : ACL, **kwargs) -> ApiResponse: # noqa: E501 - """set ACL of group # noqa: E501 + """ # noqa: E501 + + _param = self._set_group_acl_serialize( + group_id=group_id, + acl=acl, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def set_group_acl_with_http_info( + self, + group_id: StrictStr, + acl: ACL, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """set ACL of group - >>> thread = api.set_group_acl_with_http_info(group_id, acl, async_req=True) - >>> result = thread.get() :param group_id: (required) :type group_id: str :param acl: (required) :type acl: ACL - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._set_group_acl_serialize( + group_id=group_id, + acl=acl, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'group_id', - 'acl' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def set_group_acl_without_preload_content( + self, + group_id: StrictStr, + acl: ACL, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """set ACL of group + + + :param group_id: (required) + :type group_id: str + :param acl: (required) + :type acl: ACL + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_group_acl_serialize( + group_id=group_id, + acl=acl, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method set_group_acl" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['group_id']: - _path_params['groupId'] = _params['group_id'] + def _set_group_acl_serialize( + self, + group_id, + acl, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if group_id is not None: + _path_params['groupId'] = group_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['acl'] is not None: - _body_params = _params['acl'] + if acl is not None: + _body_params = acl + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/groups/{groupId}/acl', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/groups/{groupId}/acl', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_policy(self, policy_id : StrictStr, policy : Policy, **kwargs) -> Policy: # noqa: E501 - """update policy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_policy(policy_id, policy, async_req=True) - >>> result = thread.get() + + @validate_call + def update_policy( + self, + policy_id: StrictStr, + policy: Policy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Policy: + """update policy + :param policy_id: (required) :type policy_id: str :param policy: (required) :type policy: Policy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Policy - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_policy_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.update_policy_with_http_info(policy_id, policy, **kwargs) # noqa: E501 - - @validate_arguments - def update_policy_with_http_info(self, policy_id : StrictStr, policy : Policy, **kwargs) -> ApiResponse: # noqa: E501 - """update policy # noqa: E501 + """ # noqa: E501 + + _param = self._update_policy_serialize( + policy_id=policy_id, + policy=policy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "Policy", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_policy_with_http_info( + self, + policy_id: StrictStr, + policy: Policy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Policy]: + """update policy - >>> thread = api.update_policy_with_http_info(policy_id, policy, async_req=True) - >>> result = thread.get() :param policy_id: (required) :type policy_id: str :param policy: (required) :type policy: Policy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Policy, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._update_policy_serialize( + policy_id=policy_id, + policy=policy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Policy", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'policy_id', - 'policy' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def update_policy_without_preload_content( + self, + policy_id: StrictStr, + policy: Policy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update policy + + + :param policy_id: (required) + :type policy_id: str + :param policy: (required) + :type policy: Policy + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_policy_serialize( + policy_id=policy_id, + policy=policy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_policy" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Policy", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['policy_id']: - _path_params['policyId'] = _params['policy_id'] + def _update_policy_serialize( + self, + policy_id, + policy, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if policy_id is not None: + _path_params['policyId'] = policy_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['policy'] is not None: - _body_params = _params['policy'] + if policy is not None: + _body_params = policy + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "Policy", - '400': "Error", - '401': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/policies/{policyId}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/auth/policies/{policyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/branches_api.py b/clients/python/lakefs_sdk/api/branches_api.py index b17a83d0342..7b7aeebbd9d 100644 --- a/clients/python/lakefs_sdk/api/branches_api.py +++ b/clients/python/lakefs_sdk/api/branches_api.py @@ -12,24 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictStr, conint + from pydantic.v1 import Field, StrictBool, StrictStr except ImportError: - from pydantic import Field, StrictBool, StrictStr, conint - + from pydantic import Field, StrictBool, StrictStr from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.branch_creation import BranchCreation from lakefs_sdk.models.cherry_pick_creation import CherryPickCreation from lakefs_sdk.models.commit import Commit @@ -39,35 +35,45 @@ from lakefs_sdk.models.reset_creation import ResetCreation from lakefs_sdk.models.revert_creation import RevertCreation -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class BranchesApi(object): +class BranchesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def cherry_pick(self, repository : StrictStr, branch : StrictStr, cherry_pick_creation : CherryPickCreation, **kwargs) -> Commit: # noqa: E501 - """Replay the changes from the given commit on the branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def cherry_pick( + self, + repository: StrictStr, + branch: StrictStr, + cherry_pick_creation: CherryPickCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Commit: + """Replay the changes from the given commit on the branch - >>> thread = api.cherry_pick(repository, branch, cherry_pick_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -75,31 +81,79 @@ def cherry_pick(self, repository : StrictStr, branch : StrictStr, cherry_pick_cr :type branch: str :param cherry_pick_creation: (required) :type cherry_pick_creation: CherryPickCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Commit - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the cherry_pick_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.cherry_pick_with_http_info(repository, branch, cherry_pick_creation, **kwargs) # noqa: E501 - - @validate_arguments - def cherry_pick_with_http_info(self, repository : StrictStr, branch : StrictStr, cherry_pick_creation : CherryPickCreation, **kwargs) -> ApiResponse: # noqa: E501 - """Replay the changes from the given commit on the branch # noqa: E501 + """ # noqa: E501 + + _param = self._cherry_pick_serialize( + repository=repository, + branch=branch, + cherry_pick_creation=cherry_pick_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "Commit", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def cherry_pick_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + cherry_pick_creation: CherryPickCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Commit]: + """Replay the changes from the given commit on the branch - >>> thread = api.cherry_pick_with_http_info(repository, branch, cherry_pick_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -107,291 +161,547 @@ def cherry_pick_with_http_info(self, repository : StrictStr, branch : StrictStr, :type branch: str :param cherry_pick_creation: (required) :type cherry_pick_creation: CherryPickCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Commit, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._cherry_pick_serialize( + repository=repository, + branch=branch, + cherry_pick_creation=cherry_pick_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Commit", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch', - 'cherry_pick_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def cherry_pick_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + cherry_pick_creation: CherryPickCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Replay the changes from the given commit on the branch + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param cherry_pick_creation: (required) + :type cherry_pick_creation: CherryPickCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cherry_pick_serialize( + repository=repository, + branch=branch, + cherry_pick_creation=cherry_pick_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method cherry_pick" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Commit", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _cherry_pick_serialize( + self, + repository, + branch, + cherry_pick_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['branch']: - _path_params['branch'] = _params['branch'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['cherry_pick_creation'] is not None: - _body_params = _params['cherry_pick_creation'] + if cherry_pick_creation is not None: + _body_params = cherry_pick_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "Commit", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/cherry-pick', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/cherry-pick', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def create_branch(self, repository : StrictStr, branch_creation : BranchCreation, **kwargs) -> str: # noqa: E501 - """create branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_branch( + self, + repository: StrictStr, + branch_creation: BranchCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """create branch - >>> thread = api.create_branch(repository, branch_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param branch_creation: (required) :type branch_creation: BranchCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_branch_with_http_info(repository, branch_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_branch_with_http_info(self, repository : StrictStr, branch_creation : BranchCreation, **kwargs) -> ApiResponse: # noqa: E501 - """create branch # noqa: E501 + """ # noqa: E501 + + _param = self._create_branch_serialize( + repository=repository, + branch_creation=branch_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "str", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_branch_with_http_info( + self, + repository: StrictStr, + branch_creation: BranchCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """create branch - >>> thread = api.create_branch_with_http_info(repository, branch_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param branch_creation: (required) :type branch_creation: BranchCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_branch_serialize( + repository=repository, + branch_creation=branch_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "str", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_branch_without_preload_content( + self, + repository: StrictStr, + branch_creation: BranchCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create branch + + + :param repository: (required) + :type repository: str + :param branch_creation: (required) + :type branch_creation: BranchCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_branch_serialize( + repository=repository, + branch_creation=branch_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "str", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _create_branch_serialize( + self, + repository, + branch_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['branch_creation'] is not None: - _body_params = _params['branch_creation'] + if branch_creation is not None: + _body_params = branch_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['text/html', 'application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/html', + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "str", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_branch(self, repository : StrictStr, branch : StrictStr, force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 - """delete branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_branch(repository, branch, force, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_branch( + self, + repository: StrictStr, + branch: StrictStr, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete branch + :param repository: (required) :type repository: str @@ -399,31 +709,77 @@ def delete_branch(self, repository : StrictStr, branch : StrictStr, force : Opti :type branch: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_branch_with_http_info(repository, branch, force, **kwargs) # noqa: E501 - - @validate_arguments - def delete_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """delete branch # noqa: E501 + """ # noqa: E501 + + _param = self._delete_branch_serialize( + repository=repository, + branch=branch, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_branch_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete branch - >>> thread = api.delete_branch_with_http_info(repository, branch, force, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -431,118 +787,228 @@ def delete_branch_with_http_info(self, repository : StrictStr, branch : StrictSt :type branch: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_branch_serialize( + repository=repository, + branch=branch, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_branch_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete branch + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param force: + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_branch_serialize( + repository=repository, + branch=branch, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _delete_branch_serialize( + self, + repository, + branch, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/branches/{branch}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def diff_branch(self, repository : StrictStr, branch : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, **kwargs) -> DiffList: # noqa: E501 - """diff branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.diff_branch(repository, branch, after, amount, prefix, delimiter, async_req=True) - >>> result = thread.get() + + @validate_call + def diff_branch( + self, + repository: StrictStr, + branch: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiffList: + """diff branch + :param repository: (required) :type repository: str @@ -556,31 +1022,82 @@ def diff_branch(self, repository : StrictStr, branch : StrictStr, after : Annota :type prefix: str :param delimiter: delimiter used to group common prefixes by :type delimiter: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: DiffList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the diff_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.diff_branch_with_http_info(repository, branch, after, amount, prefix, delimiter, **kwargs) # noqa: E501 - - @validate_arguments - def diff_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """diff branch # noqa: E501 + """ # noqa: E501 + + _param = self._diff_branch_serialize( + repository=repository, + branch=branch, + after=after, + amount=amount, + prefix=prefix, + delimiter=delimiter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiffList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def diff_branch_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiffList]: + """diff branch - >>> thread = api.diff_branch_with_http_info(repository, branch, after, amount, prefix, delimiter, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -594,283 +1111,538 @@ def diff_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, :type prefix: str :param delimiter: delimiter used to group common prefixes by :type delimiter: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(DiffList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'after', - 'amount', - 'prefix', - 'delimiter' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._diff_branch_serialize( + repository=repository, + branch=branch, + after=after, + amount=amount, + prefix=prefix, + delimiter=delimiter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method diff_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - if _params['branch']: - _path_params['branch'] = _params['branch'] - - - # process the query parameters - _query_params = [] - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) - - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) - - if _params.get('delimiter') is not None: # noqa: E501 - _query_params.append(('delimiter', _params['delimiter'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "DiffList", '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/diff', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + ) - @validate_arguments - def get_branch(self, repository : StrictStr, branch : StrictStr, **kwargs) -> Ref: # noqa: E501 - """get branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def diff_branch_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """diff branch - >>> thread = api.get_branch(repository, branch, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param branch: (required) :type branch: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param prefix: return items prefixed with this value + :type prefix: str + :param delimiter: delimiter used to group common prefixes by + :type delimiter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Ref - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_branch_with_http_info(repository, branch, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._diff_branch_serialize( + repository=repository, + branch=branch, + after=after, + amount=amount, + prefix=prefix, + delimiter=delimiter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiffList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _diff_branch_serialize( + self, + repository, + branch, + after, + amount, + prefix, + delimiter, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if delimiter is not None: + + _query_params.append(('delimiter', delimiter)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branches/{branch}/diff', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_branch_with_http_info(repository, branch, async_req=True) - >>> result = thread.get() + @validate_call + def get_branch( + self, + repository: StrictStr, + branch: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Ref: + """get branch + :param repository: (required) :type repository: str :param branch: (required) :type branch: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Ref, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_branch_serialize( + repository=repository, + branch=branch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Ref", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_branch_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Ref]: + """get branch - _params = locals() - _all_params = [ - 'repository', - 'branch' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_branch_serialize( + repository=repository, + branch=branch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Ref", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_branch_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get branch + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_branch_serialize( + repository=repository, + branch=branch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Ref", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_branch_serialize( + self, + repository, + branch, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['branch']: - _path_params['branch'] = _params['branch'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Ref", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branches/{branch}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_branches(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> RefList: # noqa: E501 - """list branches # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_branches(repository, prefix, after, amount, async_req=True) - >>> result = thread.get() + @validate_call + def list_branches( + self, + repository: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RefList: + """list branches + :param repository: (required) :type repository: str @@ -880,31 +1652,78 @@ def list_branches(self, repository : StrictStr, prefix : Annotated[Optional[Stri :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: RefList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_branches_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_branches_with_http_info(repository, prefix, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_branches_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list branches # noqa: E501 + """ # noqa: E501 + + _param = self._list_branches_serialize( + repository=repository, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "RefList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_branches_with_http_info( + self, + repository: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RefList]: + """list branches - >>> thread = api.list_branches_with_http_info(repository, prefix, after, amount, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -914,127 +1733,235 @@ def list_branches_with_http_info(self, repository : StrictStr, prefix : Annotate :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(RefList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_branches_serialize( + repository=repository, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_branches" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "RefList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def list_branches_without_preload_content( + self, + repository: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list branches - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + :param repository: (required) + :type repository: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_branches_serialize( + repository=repository, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RefList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + def _list_branches_serialize( + self, + repository, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "RefList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def reset_branch(self, repository : StrictStr, branch : StrictStr, reset_creation : ResetCreation, **kwargs) -> None: # noqa: E501 - """reset branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.reset_branch(repository, branch, reset_creation, async_req=True) - >>> result = thread.get() + + @validate_call + def reset_branch( + self, + repository: StrictStr, + branch: StrictStr, + reset_creation: ResetCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """reset branch + :param repository: (required) :type repository: str @@ -1042,31 +1969,78 @@ def reset_branch(self, repository : StrictStr, branch : StrictStr, reset_creatio :type branch: str :param reset_creation: (required) :type reset_creation: ResetCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the reset_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.reset_branch_with_http_info(repository, branch, reset_creation, **kwargs) # noqa: E501 - - @validate_arguments - def reset_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, reset_creation : ResetCreation, **kwargs) -> ApiResponse: # noqa: E501 - """reset branch # noqa: E501 + """ # noqa: E501 + + _param = self._reset_branch_serialize( + repository=repository, + branch=branch, + reset_creation=reset_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def reset_branch_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + reset_creation: ResetCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """reset branch - >>> thread = api.reset_branch_with_http_info(repository, branch, reset_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1074,125 +2048,238 @@ def reset_branch_with_http_info(self, repository : StrictStr, branch : StrictStr :type branch: str :param reset_creation: (required) :type reset_creation: ResetCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._reset_branch_serialize( + repository=repository, + branch=branch, + reset_creation=reset_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch', - 'reset_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def reset_branch_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + reset_creation: ResetCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """reset branch + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param reset_creation: (required) + :type reset_creation: ResetCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_branch_serialize( + repository=repository, + branch=branch, + reset_creation=reset_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method reset_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _reset_branch_serialize( + self, + repository, + branch, + reset_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['reset_creation'] is not None: - _body_params = _params['reset_creation'] + if reset_creation is not None: + _body_params = reset_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/branches/{branch}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def revert_branch(self, repository : StrictStr, branch : StrictStr, revert_creation : RevertCreation, **kwargs) -> None: # noqa: E501 - """revert # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.revert_branch(repository, branch, revert_creation, async_req=True) - >>> result = thread.get() + @validate_call + def revert_branch( + self, + repository: StrictStr, + branch: StrictStr, + revert_creation: RevertCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """revert + :param repository: (required) :type repository: str @@ -1200,31 +2287,79 @@ def revert_branch(self, repository : StrictStr, branch : StrictStr, revert_creat :type branch: str :param revert_creation: (required) :type revert_creation: RevertCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the revert_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.revert_branch_with_http_info(repository, branch, revert_creation, **kwargs) # noqa: E501 - - @validate_arguments - def revert_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, revert_creation : RevertCreation, **kwargs) -> ApiResponse: # noqa: E501 - """revert # noqa: E501 + """ # noqa: E501 + + _param = self._revert_branch_serialize( + repository=repository, + branch=branch, + revert_creation=revert_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def revert_branch_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + revert_creation: RevertCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """revert - >>> thread = api.revert_branch_with_http_info(repository, branch, revert_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1232,112 +2367,214 @@ def revert_branch_with_http_info(self, repository : StrictStr, branch : StrictSt :type branch: str :param revert_creation: (required) :type revert_creation: RevertCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._revert_branch_serialize( + repository=repository, + branch=branch, + revert_creation=revert_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'branch', - 'revert_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def revert_branch_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + revert_creation: RevertCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """revert + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param revert_creation: (required) + :type revert_creation: RevertCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._revert_branch_serialize( + repository=repository, + branch=branch, + revert_creation=revert_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method revert_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _revert_branch_serialize( + self, + repository, + branch, + revert_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['revert_creation'] is not None: - _body_params = _params['revert_creation'] + if revert_creation is not None: + _body_params = revert_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/revert', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/revert', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/commits_api.py b/clients/python/lakefs_sdk/api/commits_api.py index 4e8450304b6..374e6c1133e 100644 --- a/clients/python/lakefs_sdk/api/commits_api.py +++ b/clients/python/lakefs_sdk/api/commits_api.py @@ -12,56 +12,63 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: from pydantic.v1 import Field, StrictStr except ImportError: from pydantic import Field, StrictStr - from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.commit import Commit from lakefs_sdk.models.commit_creation import CommitCreation -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class CommitsApi(object): +class CommitsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def commit(self, repository : StrictStr, branch : StrictStr, commit_creation : CommitCreation, source_metarange : Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, **kwargs) -> Commit: # noqa: E501 - """create commit # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def commit( + self, + repository: StrictStr, + branch: StrictStr, + commit_creation: CommitCreation, + source_metarange: Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Commit: + """create commit - >>> thread = api.commit(repository, branch, commit_creation, source_metarange, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -71,31 +78,82 @@ def commit(self, repository : StrictStr, branch : StrictStr, commit_creation : C :type commit_creation: CommitCreation :param source_metarange: The source metarange to commit. Branch must not have uncommitted changes. :type source_metarange: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Commit - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the commit_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.commit_with_http_info(repository, branch, commit_creation, source_metarange, **kwargs) # noqa: E501 - - @validate_arguments - def commit_with_http_info(self, repository : StrictStr, branch : StrictStr, commit_creation : CommitCreation, source_metarange : Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """create commit # noqa: E501 + """ # noqa: E501 + + _param = self._commit_serialize( + repository=repository, + branch=branch, + commit_creation=commit_creation, + source_metarange=source_metarange, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "Commit", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def commit_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + commit_creation: CommitCreation, + source_metarange: Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Commit]: + """create commit - >>> thread = api.commit_with_http_info(repository, branch, commit_creation, source_metarange, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -105,273 +163,510 @@ def commit_with_http_info(self, repository : StrictStr, branch : StrictStr, comm :type commit_creation: CommitCreation :param source_metarange: The source metarange to commit. Branch must not have uncommitted changes. :type source_metarange: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Commit, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'commit_creation', - 'source_metarange' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._commit_serialize( + repository=repository, + branch=branch, + commit_creation=commit_creation, + source_metarange=source_metarange, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Commit", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def commit_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + commit_creation: CommitCreation, + source_metarange: Annotated[Optional[StrictStr], Field(description="The source metarange to commit. Branch must not have uncommitted changes.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create commit + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param commit_creation: (required) + :type commit_creation: CommitCreation + :param source_metarange: The source metarange to commit. Branch must not have uncommitted changes. + :type source_metarange: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._commit_serialize( + repository=repository, + branch=branch, + commit_creation=commit_creation, + source_metarange=source_metarange, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method commit" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Commit", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _commit_serialize( + self, + repository, + branch, + commit_creation, + source_metarange, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('source_metarange') is not None: # noqa: E501 - _query_params.append(('source_metarange', _params['source_metarange'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if source_metarange is not None: + + _query_params.append(('source_metarange', source_metarange)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['commit_creation'] is not None: - _body_params = _params['commit_creation'] + if commit_creation is not None: + _body_params = commit_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "Commit", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '409': "Error", - '412': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/commits', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/commits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_commit(self, repository : StrictStr, commit_id : StrictStr, **kwargs) -> Commit: # noqa: E501 - """get commit # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_commit(repository, commit_id, async_req=True) - >>> result = thread.get() + @validate_call + def get_commit( + self, + repository: StrictStr, + commit_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Commit: + """get commit + :param repository: (required) :type repository: str :param commit_id: (required) :type commit_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Commit - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_commit_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_commit_with_http_info(repository, commit_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_commit_with_http_info(self, repository : StrictStr, commit_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get commit # noqa: E501 + """ # noqa: E501 + + _param = self._get_commit_serialize( + repository=repository, + commit_id=commit_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "Commit", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_commit_with_http_info( + self, + repository: StrictStr, + commit_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Commit]: + """get commit - >>> thread = api.get_commit_with_http_info(repository, commit_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param commit_id: (required) :type commit_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Commit, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_commit_serialize( + repository=repository, + commit_id=commit_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Commit", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'commit_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_commit_without_preload_content( + self, + repository: StrictStr, + commit_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get commit + + + :param repository: (required) + :type repository: str + :param commit_id: (required) + :type commit_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_commit_serialize( + repository=repository, + commit_id=commit_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_commit" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Commit", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_commit_serialize( + self, + repository, + commit_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['commit_id']: - _path_params['commitId'] = _params['commit_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if commit_id is not None: + _path_params['commitId'] = commit_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Commit", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/commits/{commitId}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/commits/{commitId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/config_api.py b/clients/python/lakefs_sdk/api/config_api.py index eb2132da2fa..e8072eb5ad5 100644 --- a/clients/python/lakefs_sdk/api/config_api.py +++ b/clients/python/lakefs_sdk/api/config_api.py @@ -12,167 +12,280 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from lakefs_sdk.models.config import Config -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class ConfigApi(object): +class ConfigApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_config(self, **kwargs) -> Config: # noqa: E501 - """get_config # noqa: E501 - retrieve lakeFS configuration # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_config( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Config: + """get_config - >>> thread = api.get_config(async_req=True) - >>> result = thread.get() + retrieve lakeFS configuration - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Config - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_config_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_config_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_config_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get_config # noqa: E501 - - retrieve lakeFS configuration # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_config_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Config", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_config_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Config]: + """get_config + + retrieve lakeFS configuration + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Config, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "Config", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_config_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_config + + retrieve lakeFS configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_config" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Config", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_config_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Config", - '401': "Error", - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/config', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/config', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/experimental_api.py b/clients/python/lakefs_sdk/api/experimental_api.py index 2df5e2d6f68..d562d475158 100644 --- a/clients/python/lakefs_sdk/api/experimental_api.py +++ b/clients/python/lakefs_sdk/api/experimental_api.py @@ -12,24 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictInt, StrictStr, conint + from pydantic.v1 import Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import Field, StrictBool, StrictInt, StrictStr, conint - + from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.abort_presign_multipart_upload import AbortPresignMultipartUpload from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.complete_presign_multipart_upload import CompletePresignMultipartUpload @@ -41,36 +37,48 @@ from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload from lakefs_sdk.models.sts_auth_request import StsAuthRequest -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class ExperimentalApi(object): +class ExperimentalApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def abort_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], abort_presign_multipart_upload : Optional[AbortPresignMultipartUpload] = None, **kwargs) -> None: # noqa: E501 - """Abort a presign multipart upload # noqa: E501 - Aborts a presign multipart upload. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def abort_presign_multipart_upload( + self, + repository: StrictStr, + branch: StrictStr, + upload_id: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + abort_presign_multipart_upload: Optional[AbortPresignMultipartUpload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Abort a presign multipart upload - >>> thread = api.abort_presign_multipart_upload(repository, branch, upload_id, path, abort_presign_multipart_upload, async_req=True) - >>> result = thread.get() + Aborts a presign multipart upload. :param repository: (required) :type repository: str @@ -82,32 +90,82 @@ def abort_presign_multipart_upload(self, repository : StrictStr, branch : Strict :type path: str :param abort_presign_multipart_upload: :type abort_presign_multipart_upload: AbortPresignMultipartUpload - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the abort_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.abort_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, abort_presign_multipart_upload, **kwargs) # noqa: E501 - - @validate_arguments - def abort_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], abort_presign_multipart_upload : Optional[AbortPresignMultipartUpload] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Abort a presign multipart upload # noqa: E501 - - Aborts a presign multipart upload. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.abort_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, abort_presign_multipart_upload, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._abort_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + upload_id=upload_id, + path=path, + abort_presign_multipart_upload=abort_presign_multipart_upload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def abort_presign_multipart_upload_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + upload_id: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + abort_presign_multipart_upload: Optional[AbortPresignMultipartUpload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Abort a presign multipart upload + + Aborts a presign multipart upload. :param repository: (required) :type repository: str @@ -119,134 +177,258 @@ def abort_presign_multipart_upload_with_http_info(self, repository : StrictStr, :type path: str :param abort_presign_multipart_upload: :type abort_presign_multipart_upload: AbortPresignMultipartUpload - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'upload_id', - 'path', - 'abort_presign_multipart_upload' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._abort_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + upload_id=upload_id, + path=path, + abort_presign_multipart_upload=abort_presign_multipart_upload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def abort_presign_multipart_upload_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + upload_id: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + abort_presign_multipart_upload: Optional[AbortPresignMultipartUpload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Abort a presign multipart upload + + Aborts a presign multipart upload. + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param upload_id: (required) + :type upload_id: str + :param path: relative to the branch (required) + :type path: str + :param abort_presign_multipart_upload: + :type abort_presign_multipart_upload: AbortPresignMultipartUpload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._abort_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + upload_id=upload_id, + path=path, + abort_presign_multipart_upload=abort_presign_multipart_upload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method abort_presign_multipart_upload" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _abort_presign_multipart_upload_serialize( + self, + repository, + branch, + upload_id, + path, + abort_presign_multipart_upload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None - if _params['upload_id']: - _path_params['uploadId'] = _params['upload_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + if upload_id is not None: + _path_params['uploadId'] = upload_id # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) - + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['abort_presign_multipart_upload'] is not None: - _body_params = _params['abort_presign_multipart_upload'] + if abort_presign_multipart_upload is not None: + _body_params = abort_presign_multipart_upload + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def complete_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], complete_presign_multipart_upload : Optional[CompletePresignMultipartUpload] = None, **kwargs) -> ObjectStats: # noqa: E501 - """Complete a presign multipart upload request # noqa: E501 - Completes a presign multipart upload by assembling the uploaded parts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.complete_presign_multipart_upload(repository, branch, upload_id, path, complete_presign_multipart_upload, async_req=True) - >>> result = thread.get() + + @validate_call + def complete_presign_multipart_upload( + self, + repository: StrictStr, + branch: StrictStr, + upload_id: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + complete_presign_multipart_upload: Optional[CompletePresignMultipartUpload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStats: + """Complete a presign multipart upload request + + Completes a presign multipart upload by assembling the uploaded parts. :param repository: (required) :type repository: str @@ -258,32 +440,83 @@ def complete_presign_multipart_upload(self, repository : StrictStr, branch : Str :type path: str :param complete_presign_multipart_upload: :type complete_presign_multipart_upload: CompletePresignMultipartUpload - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStats - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the complete_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.complete_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, complete_presign_multipart_upload, **kwargs) # noqa: E501 - - @validate_arguments - def complete_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, upload_id : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], complete_presign_multipart_upload : Optional[CompletePresignMultipartUpload] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Complete a presign multipart upload request # noqa: E501 - - Completes a presign multipart upload by assembling the uploaded parts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.complete_presign_multipart_upload_with_http_info(repository, branch, upload_id, path, complete_presign_multipart_upload, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._complete_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + upload_id=upload_id, + path=path, + complete_presign_multipart_upload=complete_presign_multipart_upload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '400': "Error", + '401': "Error", + '404': "Error", + '409': "StagingLocation", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def complete_presign_multipart_upload_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + upload_id: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + complete_presign_multipart_upload: Optional[CompletePresignMultipartUpload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStats]: + """Complete a presign multipart upload request + + Completes a presign multipart upload by assembling the uploaded parts. :param repository: (required) :type repository: str @@ -295,141 +528,259 @@ def complete_presign_multipart_upload_with_http_info(self, repository : StrictSt :type path: str :param complete_presign_multipart_upload: :type complete_presign_multipart_upload: CompletePresignMultipartUpload - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'upload_id', - 'path', - 'complete_presign_multipart_upload' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._complete_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + upload_id=upload_id, + path=path, + complete_presign_multipart_upload=complete_presign_multipart_upload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '400': "Error", + '401': "Error", + '404': "Error", + '409': "StagingLocation", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def complete_presign_multipart_upload_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + upload_id: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + complete_presign_multipart_upload: Optional[CompletePresignMultipartUpload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Complete a presign multipart upload request + + Completes a presign multipart upload by assembling the uploaded parts. + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param upload_id: (required) + :type upload_id: str + :param path: relative to the branch (required) + :type path: str + :param complete_presign_multipart_upload: + :type complete_presign_multipart_upload: CompletePresignMultipartUpload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._complete_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + upload_id=upload_id, + path=path, + complete_presign_multipart_upload=complete_presign_multipart_upload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method complete_presign_multipart_upload" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '400': "Error", + '401': "Error", + '404': "Error", + '409': "StagingLocation", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _complete_presign_multipart_upload_serialize( + self, + repository, + branch, + upload_id, + path, + complete_presign_multipart_upload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None - if _params['upload_id']: - _path_params['uploadId'] = _params['upload_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + if upload_id is not None: + _path_params['uploadId'] = upload_id # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) - + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['complete_presign_multipart_upload'] is not None: - _body_params = _params['complete_presign_multipart_upload'] + if complete_presign_multipart_upload is not None: + _body_params = complete_presign_multipart_upload + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "ObjectStats", - '400': "Error", - '401': "Error", - '404': "Error", - '409': "StagingLocation", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/branches/{branch}/staging/pmpu/{uploadId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def create_presign_multipart_upload(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], parts : Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, **kwargs) -> PresignMultipartUpload: # noqa: E501 - """Initiate a multipart upload # noqa: E501 - Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_presign_multipart_upload( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + parts: Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PresignMultipartUpload: + """Initiate a multipart upload - >>> thread = api.create_presign_multipart_upload(repository, branch, path, parts, async_req=True) - >>> result = thread.get() + Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). :param repository: (required) :type repository: str @@ -439,32 +790,80 @@ def create_presign_multipart_upload(self, repository : StrictStr, branch : Stric :type path: str :param parts: number of presigned URL parts required to upload :type parts: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PresignMultipartUpload - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_presign_multipart_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_presign_multipart_upload_with_http_info(repository, branch, path, parts, **kwargs) # noqa: E501 - - @validate_arguments - def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], parts : Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Initiate a multipart upload # noqa: E501 - - Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_presign_multipart_upload_with_http_info(repository, branch, path, parts, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + path=path, + parts=parts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PresignMultipartUpload", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_presign_multipart_upload_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + parts: Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PresignMultipartUpload]: + """Initiate a multipart upload + + Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). :param repository: (required) :type repository: str @@ -474,544 +873,871 @@ def create_presign_multipart_upload_with_http_info(self, repository : StrictStr, :type path: str :param parts: number of presigned URL parts required to upload :type parts: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PresignMultipartUpload, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'path', - 'parts' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._create_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + path=path, + parts=parts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_presign_multipart_upload" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - if _params['branch']: - _path_params['branch'] = _params['branch'] - - - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) - - if _params.get('parts') is not None: # noqa: E501 - _query_params.append(('parts', _params['parts'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '201': "PresignMultipartUpload", '400': "Error", '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/pmpu', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def create_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> None: # noqa: E501 - """attach external principal to user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) - >>> result = thread.get() - - :param user_id: (required) - :type user_id: str - :param principal_id: (required) - :type principal_id: str - :param external_principal_creation: - :type external_principal_creation: ExternalPrincipalCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **kwargs) # noqa: E501 + ) - @validate_arguments - def create_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """attach external principal to user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_presign_multipart_upload_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + parts: Annotated[Optional[StrictInt], Field(description="number of presigned URL parts required to upload")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Initiate a multipart upload - >>> thread = api.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, async_req=True) - >>> result = thread.get() + Initiates a multipart upload and returns an upload ID with presigned URLs for each part (optional). Part numbers starts with 1. Each part except the last one has minimum size depends on the underlying blockstore implementation. For example working with S3 blockstore, minimum size is 5MB (excluding the last part). - :param user_id: (required) - :type user_id: str - :param principal_id: (required) - :type principal_id: str - :param external_principal_creation: - :type external_principal_creation: ExternalPrincipalCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param parts: number of presigned URL parts required to upload + :type parts: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() + """ # noqa: E501 + + _param = self._create_presign_multipart_upload_serialize( + repository=repository, + branch=branch, + path=path, + parts=parts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'user_id', - 'principal_id', - 'external_principal_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PresignMultipartUpload", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _create_presign_multipart_upload_serialize( + self, + repository, + branch, + path, + parts, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + + if parts is not None: + + _query_params.append(('parts', parts)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['external_principal_creation'] is not None: - _body_params = _params['external_principal_creation'] + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/staging/pmpu', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def delete_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete external principal from user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) - >>> result = thread.get() - :param user_id: (required) - :type user_id: str - :param principal_id: (required) - :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_user_external_principal_with_http_info(user_id, principal_id, **kwargs) # noqa: E501 - @validate_arguments - def delete_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete external principal from user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_user_external_principal( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """attach external principal to user - >>> thread = api.delete_user_external_principal_with_http_info(user_id, principal_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_user_external_principal_with_http_info( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """attach external principal to user - _params = locals() - _all_params = [ - 'user_id', - 'principal_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_user_external_principal_without_preload_content( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """attach external principal to user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _create_user_external_principal_serialize( + self, + user_id, + principal_id, + external_principal_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + if external_principal_creation is not None: + _body_params = external_principal_creation + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/users/{userId}/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def external_principal_login(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> AuthenticationToken: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.external_principal_login(external_login_information, async_req=True) - >>> result = thread.get() - :param external_login_information: - :type external_login_information: ExternalLoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def delete_user_external_principal( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete external principal from user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthenticationToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 - - @validate_arguments - def external_principal_login_with_http_info(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_user_external_principal_with_http_info( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete external principal from user - >>> thread = api.external_principal_login_with_http_info(external_login_information, async_req=True) - >>> result = thread.get() - :param external_login_information: - :type external_login_information: ExternalLoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'external_login_information' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_user_external_principal_without_preload_content( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete external principal from user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method external_principal_login" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _delete_user_external_principal_serialize( + self, + user_id, + principal_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id # process the query parameters - _query_params = [] + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['external_login_information'] is not None: - _body_params = _params['external_login_information'] + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list # authentication setting - _auth_settings = [] # noqa: E501 + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/users/{userId}/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def external_principal_login( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthenticationToken: + """perform a login using an external authenticator + + + :param external_login_information: + :type external_login_information: ExternalLoginInformation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "AuthenticationToken", '400': "Error", '401': "Error", @@ -1019,174 +1745,523 @@ def external_principal_login_with_http_info(self, external_login_information : O '404': "Error", '420': None, } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def external_principal_login_with_http_info( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthenticationToken]: + """perform a login using an external authenticator + + + :param external_login_information: + :type external_login_information: ExternalLoginInformation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + - return self.api_client.call_api( - '/auth/external/principal/login', 'POST', - _path_params, - _query_params, - _header_params, + @validate_call + def external_principal_login_without_preload_content( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """perform a login using an external authenticator + + + :param external_login_information: + :type external_login_information: ExternalLoginInformation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _external_principal_login_serialize( + self, + external_login_information, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if external_login_information is not None: + _body_params = external_login_information + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/external/principal/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_external_principal(self, principal_id : StrictStr, **kwargs) -> ExternalPrincipal: # noqa: E501 - """describe external principal by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_principal(principal_id, async_req=True) - >>> result = thread.get() + + @validate_call + def get_external_principal( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExternalPrincipal: + """describe external principal by id + :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ExternalPrincipal - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_external_principal_with_http_info(principal_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """describe external principal by id # noqa: E501 + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_external_principal_with_http_info( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExternalPrincipal]: + """describe external principal by id - >>> thread = api.get_external_principal_with_http_info(principal_id, async_req=True) - >>> result = thread.get() :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ExternalPrincipal, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'principal_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_external_principal_without_preload_content( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """describe external principal by id + + + :param principal_id: (required) + :type principal_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_external_principal_serialize( + self, + principal_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ExternalPrincipal", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/external/principals', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def hard_reset_branch(self, repository : StrictStr, branch : StrictStr, ref : Annotated[StrictStr, Field(..., description="After reset, branch will point at this reference.")], force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 - """hard reset branch # noqa: E501 - Relocate branch to refer to ref. Branch must not contain uncommitted data. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.hard_reset_branch(repository, branch, ref, force, async_req=True) - >>> result = thread.get() + @validate_call + def hard_reset_branch( + self, + repository: StrictStr, + branch: StrictStr, + ref: Annotated[StrictStr, Field(description="After reset, branch will point at this reference.")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """hard reset branch + + Relocate branch to refer to ref. Branch must not contain uncommitted data. :param repository: (required) :type repository: str @@ -1196,32 +2271,81 @@ def hard_reset_branch(self, repository : StrictStr, branch : StrictStr, ref : An :type ref: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the hard_reset_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.hard_reset_branch_with_http_info(repository, branch, ref, force, **kwargs) # noqa: E501 - - @validate_arguments - def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : StrictStr, ref : Annotated[StrictStr, Field(..., description="After reset, branch will point at this reference.")], force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """hard reset branch # noqa: E501 - - Relocate branch to refer to ref. Branch must not contain uncommitted data. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.hard_reset_branch_with_http_info(repository, branch, ref, force, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._hard_reset_branch_serialize( + repository=repository, + branch=branch, + ref=ref, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def hard_reset_branch_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + ref: Annotated[StrictStr, Field(description="After reset, branch will point at this reference.")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """hard reset branch + + Relocate branch to refer to ref. Branch must not contain uncommitted data. :param repository: (required) :type repository: str @@ -1231,122 +2355,239 @@ def hard_reset_branch_with_http_info(self, repository : StrictStr, branch : Stri :type ref: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'ref', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._hard_reset_branch_serialize( + repository=repository, + branch=branch, + ref=ref, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method hard_reset_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def hard_reset_branch_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + ref: Annotated[StrictStr, Field(description="After reset, branch will point at this reference.")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """hard reset branch - if _params['branch']: - _path_params['branch'] = _params['branch'] + Relocate branch to refer to ref. Branch must not contain uncommitted data. + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param ref: After reset, branch will point at this reference. (required) + :type ref: str + :param force: + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._hard_reset_branch_serialize( + repository=repository, + branch=branch, + ref=ref, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - # process the query parameters - _query_params = [] - if _params.get('ref') is not None: # noqa: E501 - _query_params.append(('ref', _params['ref'])) + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _hard_reset_branch_serialize( + self, + repository, + branch, + ref, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if ref is not None: + + _query_params.append(('ref', ref)) + + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/hard_reset', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/branches/{branch}/hard_reset', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_user_external_principals(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ExternalPrincipalList: # noqa: E501 - """list user external policies attached to a user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_user_external_principals(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() + @validate_call + def list_user_external_principals( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExternalPrincipalList: + """list user external policies attached to a user + :param user_id: (required) :type user_id: str @@ -1356,31 +2597,78 @@ def list_user_external_principals(self, user_id : StrictStr, prefix : Annotated[ :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ExternalPrincipalList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_user_external_principals_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_user_external_principals_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_user_external_principals_with_http_info(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list user external policies attached to a user # noqa: E501 + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_user_external_principals_with_http_info( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExternalPrincipalList]: + """list user external policies attached to a user - >>> thread = api.list_user_external_principals_with_http_info(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -1390,260 +2678,483 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ExternalPrincipalList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_user_external_principals" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + @validate_call + def list_user_external_principals_without_preload_content( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list user external policies attached to a user - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + :param user_id: (required) + :type user_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + def _list_user_external_principals_serialize( + self, + user_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ExternalPrincipalList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals/ls', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/external/principals/ls', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def sts_login(self, sts_auth_request : StsAuthRequest, **kwargs) -> AuthenticationToken: # noqa: E501 - """perform a login with STS # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def sts_login( + self, + sts_auth_request: StsAuthRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthenticationToken: + """perform a login with STS - >>> thread = api.sts_login(sts_auth_request, async_req=True) - >>> result = thread.get() :param sts_auth_request: (required) :type sts_auth_request: StsAuthRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthenticationToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the sts_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.sts_login_with_http_info(sts_auth_request, **kwargs) # noqa: E501 - - @validate_arguments - def sts_login_with_http_info(self, sts_auth_request : StsAuthRequest, **kwargs) -> ApiResponse: # noqa: E501 - """perform a login with STS # noqa: E501 + """ # noqa: E501 + + _param = self._sts_login_serialize( + sts_auth_request=sts_auth_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def sts_login_with_http_info( + self, + sts_auth_request: StsAuthRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthenticationToken]: + """perform a login with STS - >>> thread = api.sts_login_with_http_info(sts_auth_request, async_req=True) - >>> result = thread.get() :param sts_auth_request: (required) :type sts_auth_request: StsAuthRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._sts_login_serialize( + sts_auth_request=sts_auth_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'sts_auth_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def sts_login_without_preload_content( + self, + sts_auth_request: StsAuthRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """perform a login with STS + + + :param sts_auth_request: (required) + :type sts_auth_request: StsAuthRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sts_login_serialize( + sts_auth_request=sts_auth_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method sts_login" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _sts_login_serialize( + self, + sts_auth_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['sts_auth_request'] is not None: - _body_params = _params['sts_auth_request'] + if sts_auth_request is not None: + _body_params = sts_auth_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "AuthenticationToken", - '401': "Error", - '420': None, - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/sts/login', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/sts/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/external_api.py b/clients/python/lakefs_sdk/api/external_api.py index 6f905491490..19e7ed052aa 100644 --- a/clients/python/lakefs_sdk/api/external_api.py +++ b/clients/python/lakefs_sdk/api/external_api.py @@ -12,59 +12,65 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictStr, conint + from pydantic.v1 import Field, StrictStr except ImportError: - from pydantic import Field, StrictStr, conint - + from pydantic import Field, StrictStr from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.authentication_token import AuthenticationToken from lakefs_sdk.models.external_login_information import ExternalLoginInformation from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation from lakefs_sdk.models.external_principal_list import ExternalPrincipalList -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class ExternalApi(object): +class ExternalApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> None: # noqa: E501 - """attach external principal to user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_user_external_principal( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """attach external principal to user - >>> thread = api.create_user_external_principal(user_id, principal_id, external_principal_creation, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -72,31 +78,77 @@ def create_user_external_principal(self, user_id : StrictStr, principal_id : Str :type principal_id: str :param external_principal_creation: :type external_principal_creation: ExternalPrincipalCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, external_principal_creation : Optional[ExternalPrincipalCreation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """attach external principal to user # noqa: E501 + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_user_external_principal_with_http_info( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """attach external principal to user - >>> thread = api.create_user_external_principal_with_http_info(user_id, principal_id, external_principal_creation, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -104,557 +156,1079 @@ def create_user_external_principal_with_http_info(self, user_id : StrictStr, pri :type principal_id: str :param external_principal_creation: :type external_principal_creation: ExternalPrincipalCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id', - 'principal_id', - 'external_principal_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_user_external_principal_without_preload_content( + self, + user_id: StrictStr, + principal_id: StrictStr, + external_principal_creation: Optional[ExternalPrincipalCreation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """attach external principal to user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param external_principal_creation: + :type external_principal_creation: ExternalPrincipalCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + external_principal_creation=external_principal_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _create_user_external_principal_serialize( + self, + user_id, + principal_id, + external_principal_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['external_principal_creation'] is not None: - _body_params = _params['external_principal_creation'] + if external_principal_creation is not None: + _body_params = external_principal_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/users/{userId}/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_user_external_principal(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> None: # noqa: E501 - """delete external principal from user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_external_principal(user_id, principal_id, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_user_external_principal( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete external principal from user + :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_user_external_principal_with_http_info(user_id, principal_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_user_external_principal_with_http_info(self, user_id : StrictStr, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete external principal from user # noqa: E501 + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_user_external_principal_with_http_info( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete external principal from user - >>> thread = api.delete_user_external_principal_with_http_info(user_id, principal_id, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_id', - 'principal_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_user_external_principal_without_preload_content( + self, + user_id: StrictStr, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete external principal from user + + + :param user_id: (required) + :type user_id: str + :param principal_id: (required) + :type principal_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_external_principal_serialize( + user_id=user_id, + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + def _delete_user_external_principal_serialize( + self, + user_id, + principal_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/auth/users/{userId}/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def external_principal_login(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> AuthenticationToken: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.external_principal_login(external_login_information, async_req=True) - >>> result = thread.get() + @validate_call + def external_principal_login( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthenticationToken: + """perform a login using an external authenticator + :param external_login_information: :type external_login_information: ExternalLoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthenticationToken - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the external_principal_login_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.external_principal_login_with_http_info(external_login_information, **kwargs) # noqa: E501 - - @validate_arguments - def external_principal_login_with_http_info(self, external_login_information : Optional[ExternalLoginInformation] = None, **kwargs) -> ApiResponse: # noqa: E501 - """perform a login using an external authenticator # noqa: E501 + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def external_principal_login_with_http_info( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthenticationToken]: + """perform a login using an external authenticator - >>> thread = api.external_principal_login_with_http_info(external_login_information, async_req=True) - >>> result = thread.get() :param external_login_information: :type external_login_information: ExternalLoginInformation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthenticationToken, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'external_login_information' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def external_principal_login_without_preload_content( + self, + external_login_information: Optional[ExternalLoginInformation] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """perform a login using an external authenticator + + + :param external_login_information: + :type external_login_information: ExternalLoginInformation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._external_principal_login_serialize( + external_login_information=external_login_information, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method external_principal_login" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthenticationToken", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _external_principal_login_serialize( + self, + external_login_information, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['external_login_information'] is not None: - _body_params = _params['external_login_information'] + if external_login_information is not None: + _body_params = external_login_information + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "AuthenticationToken", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/auth/external/principal/login', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/auth/external/principal/login', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_external_principal(self, principal_id : StrictStr, **kwargs) -> ExternalPrincipal: # noqa: E501 - """describe external principal by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_external_principal(principal_id, async_req=True) - >>> result = thread.get() + + @validate_call + def get_external_principal( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExternalPrincipal: + """describe external principal by id + :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ExternalPrincipal - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_external_principal_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_external_principal_with_http_info(principal_id, **kwargs) # noqa: E501 - - @validate_arguments - def get_external_principal_with_http_info(self, principal_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """describe external principal by id # noqa: E501 + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_external_principal_with_http_info( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExternalPrincipal]: + """describe external principal by id - >>> thread = api.get_external_principal_with_http_info(principal_id, async_req=True) - >>> result = thread.get() :param principal_id: (required) :type principal_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ExternalPrincipal, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'principal_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_external_principal_without_preload_content( + self, + principal_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """describe external principal by id + + + :param principal_id: (required) + :type principal_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_external_principal_serialize( + principal_id=principal_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_external_principal" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipal", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_external_principal_serialize( + self, + principal_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('principal_id') is not None: # noqa: E501 - _query_params.append(('principalId', _params['principal_id'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if principal_id is not None: + + _query_params.append(('principalId', principal_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ExternalPrincipal", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/external/principals', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/external/principals', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def list_user_external_principals(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ExternalPrincipalList: # noqa: E501 - """list user external policies attached to a user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_user_external_principals( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExternalPrincipalList: + """list user external policies attached to a user - >>> thread = api.list_user_external_principals(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -664,31 +1238,78 @@ def list_user_external_principals(self, user_id : StrictStr, prefix : Annotated[ :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ExternalPrincipalList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_user_external_principals_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_user_external_principals_with_http_info(user_id, prefix, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_user_external_principals_with_http_info(self, user_id : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list user external policies attached to a user # noqa: E501 + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_user_external_principals_with_http_info( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExternalPrincipalList]: + """list user external policies attached to a user - >>> thread = api.list_user_external_principals_with_http_info(user_id, prefix, after, amount, async_req=True) - >>> result = thread.get() :param user_id: (required) :type user_id: str @@ -698,114 +1319,209 @@ def list_user_external_principals_with_http_info(self, user_id : StrictStr, pref :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ExternalPrincipalList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'user_id', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_user_external_principals" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['user_id']: - _path_params['userId'] = _params['user_id'] + @validate_call + def list_user_external_principals_without_preload_content( + self, + user_id: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list user external policies attached to a user - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + :param user_id: (required) + :type user_id: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_user_external_principals_serialize( + user_id=user_id, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExternalPrincipalList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + def _list_user_external_principals_serialize( + self, + user_id, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ExternalPrincipalList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/auth/users/{userId}/external/principals/ls', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/users/{userId}/external/principals/ls', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/health_check_api.py b/clients/python/lakefs_sdk/api/health_check_api.py index 822c1592777..eefaac71052 100644 --- a/clients/python/lakefs_sdk/api/health_check_api.py +++ b/clients/python/lakefs_sdk/api/health_check_api.py @@ -12,159 +12,264 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class HealthCheckApi(object): +class HealthCheckApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def health_check(self, **kwargs) -> None: # noqa: E501 - """health_check # noqa: E501 - check that the API server is up and running # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def health_check( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """health_check - >>> thread = api.health_check(async_req=True) - >>> result = thread.get() + check that the API server is up and running - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the health_check_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.health_check_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def health_check_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """health_check # noqa: E501 - - check that the API server is up and running # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.health_check_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def health_check_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """health_check + + check that the API server is up and running + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 - _params = locals() + _param = self._health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def health_check_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """health_check + + check that the API server is up and running + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method health_check" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _health_check_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/healthcheck', 'GET', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/healthcheck', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/import_api.py b/clients/python/lakefs_sdk/api/import_api.py index 0ab12b3a302..b036ebc545a 100644 --- a/clients/python/lakefs_sdk/api/import_api.py +++ b/clients/python/lakefs_sdk/api/import_api.py @@ -12,55 +12,62 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: from pydantic.v1 import Field, StrictStr except ImportError: from pydantic import Field, StrictStr - +from typing_extensions import Annotated from lakefs_sdk.models.import_creation import ImportCreation from lakefs_sdk.models.import_creation_response import ImportCreationResponse from lakefs_sdk.models.import_status import ImportStatus -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class ImportApi(object): +class ImportApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def import_cancel(self, repository : StrictStr, branch : StrictStr, id : Annotated[StrictStr, Field(..., description="Unique identifier of the import process")], **kwargs) -> None: # noqa: E501 - """cancel ongoing import # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def import_cancel( + self, + repository: StrictStr, + branch: StrictStr, + id: Annotated[StrictStr, Field(description="Unique identifier of the import process")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """cancel ongoing import - >>> thread = api.import_cancel(repository, branch, id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -68,31 +75,78 @@ def import_cancel(self, repository : StrictStr, branch : StrictStr, id : Annotat :type branch: str :param id: Unique identifier of the import process (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the import_cancel_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.import_cancel_with_http_info(repository, branch, id, **kwargs) # noqa: E501 - - @validate_arguments - def import_cancel_with_http_info(self, repository : StrictStr, branch : StrictStr, id : Annotated[StrictStr, Field(..., description="Unique identifier of the import process")], **kwargs) -> ApiResponse: # noqa: E501 - """cancel ongoing import # noqa: E501 + """ # noqa: E501 + + _param = self._import_cancel_serialize( + repository=repository, + branch=branch, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def import_cancel_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + id: Annotated[StrictStr, Field(description="Unique identifier of the import process")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """cancel ongoing import - >>> thread = api.import_cancel_with_http_info(repository, branch, id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -100,118 +154,227 @@ def import_cancel_with_http_info(self, repository : StrictStr, branch : StrictSt :type branch: str :param id: Unique identifier of the import process (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._import_cancel_serialize( + repository=repository, + branch=branch, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch', - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def import_cancel_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + id: Annotated[StrictStr, Field(description="Unique identifier of the import process")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """cancel ongoing import + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param id: Unique identifier of the import process (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_cancel_serialize( + repository=repository, + branch=branch, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method import_cancel" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _import_cancel_serialize( + self, + repository, + branch, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('id') is not None: # noqa: E501 - _query_params.append(('id', _params['id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if id is not None: + + _query_params.append(('id', id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/import', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/branches/{branch}/import', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def import_start(self, repository : StrictStr, branch : StrictStr, import_creation : ImportCreation, **kwargs) -> ImportCreationResponse: # noqa: E501 - """import data from object store # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.import_start(repository, branch, import_creation, async_req=True) - >>> result = thread.get() + + @validate_call + def import_start( + self, + repository: StrictStr, + branch: StrictStr, + import_creation: ImportCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImportCreationResponse: + """import data from object store + :param repository: (required) :type repository: str @@ -219,31 +382,78 @@ def import_start(self, repository : StrictStr, branch : StrictStr, import_creati :type branch: str :param import_creation: (required) :type import_creation: ImportCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImportCreationResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the import_start_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.import_start_with_http_info(repository, branch, import_creation, **kwargs) # noqa: E501 - - @validate_arguments - def import_start_with_http_info(self, repository : StrictStr, branch : StrictStr, import_creation : ImportCreation, **kwargs) -> ApiResponse: # noqa: E501 - """import data from object store # noqa: E501 + """ # noqa: E501 + + _param = self._import_start_serialize( + repository=repository, + branch=branch, + import_creation=import_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '202': "ImportCreationResponse", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def import_start_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + import_creation: ImportCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImportCreationResponse]: + """import data from object store - >>> thread = api.import_start_with_http_info(repository, branch, import_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -251,132 +461,238 @@ def import_start_with_http_info(self, repository : StrictStr, branch : StrictStr :type branch: str :param import_creation: (required) :type import_creation: ImportCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImportCreationResponse, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._import_start_serialize( + repository=repository, + branch=branch, + import_creation=import_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '202': "ImportCreationResponse", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'branch', - 'import_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def import_start_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + import_creation: ImportCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """import data from object store + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param import_creation: (required) + :type import_creation: ImportCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_start_serialize( + repository=repository, + branch=branch, + import_creation=import_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method import_start" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '202': "ImportCreationResponse", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _import_start_serialize( + self, + repository, + branch, + import_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['branch']: - _path_params['branch'] = _params['branch'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['import_creation'] is not None: - _body_params = _params['import_creation'] + if import_creation is not None: + _body_params = import_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '202': "ImportCreationResponse", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/import', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/import', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def import_status(self, repository : StrictStr, branch : StrictStr, id : Annotated[StrictStr, Field(..., description="Unique identifier of the import process")], **kwargs) -> ImportStatus: # noqa: E501 - """get import status # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def import_status( + self, + repository: StrictStr, + branch: StrictStr, + id: Annotated[StrictStr, Field(description="Unique identifier of the import process")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImportStatus: + """get import status - >>> thread = api.import_status(repository, branch, id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -384,31 +700,76 @@ def import_status(self, repository : StrictStr, branch : StrictStr, id : Annotat :type branch: str :param id: Unique identifier of the import process (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImportStatus - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the import_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.import_status_with_http_info(repository, branch, id, **kwargs) # noqa: E501 - - @validate_arguments - def import_status_with_http_info(self, repository : StrictStr, branch : StrictStr, id : Annotated[StrictStr, Field(..., description="Unique identifier of the import process")], **kwargs) -> ApiResponse: # noqa: E501 - """get import status # noqa: E501 + """ # noqa: E501 + + _param = self._import_status_serialize( + repository=repository, + branch=branch, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportStatus", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def import_status_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + id: Annotated[StrictStr, Field(description="Unique identifier of the import process")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImportStatus]: + """get import status - >>> thread = api.import_status_with_http_info(repository, branch, id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -416,110 +777,197 @@ def import_status_with_http_info(self, repository : StrictStr, branch : StrictSt :type branch: str :param id: Unique identifier of the import process (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImportStatus, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._import_status_serialize( + repository=repository, + branch=branch, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportStatus", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch', - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def import_status_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + id: Annotated[StrictStr, Field(description="Unique identifier of the import process")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get import status + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param id: Unique identifier of the import process (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_status_serialize( + repository=repository, + branch=branch, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method import_status" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImportStatus", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _import_status_serialize( + self, + repository, + branch, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('id') is not None: # noqa: E501 - _query_params.append(('id', _params['id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if id is not None: + + _query_params.append(('id', id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ImportStatus", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/import', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branches/{branch}/import', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/internal_api.py b/clients/python/lakefs_sdk/api/internal_api.py index 9a3cb165c13..8389c76c3e4 100644 --- a/clients/python/lakefs_sdk/api/internal_api.py +++ b/clients/python/lakefs_sdk/api/internal_api.py @@ -12,24 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictStr + from pydantic.v1 import Field, StrictBool, StrictBytes, StrictStr, field_validator except ImportError: - from pydantic import Field, StrictBool, StrictStr - + from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator from typing import List, Optional, Union - +from typing_extensions import Annotated from lakefs_sdk.models.auth_capabilities import AuthCapabilities from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule from lakefs_sdk.models.comm_prefs_input import CommPrefsInput @@ -55,320 +51,620 @@ from lakefs_sdk.models.storage_uri import StorageURI from lakefs_sdk.models.version_config import VersionConfig -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class InternalApi(object): +class InternalApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_branch_protection_rule_preflight(self, repository : StrictStr, **kwargs) -> None: # noqa: E501 - """create_branch_protection_rule_preflight # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_branch_protection_rule_preflight( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """create_branch_protection_rule_preflight - >>> thread = api.create_branch_protection_rule_preflight(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_branch_protection_rule_preflight_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_branch_protection_rule_preflight_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def create_branch_protection_rule_preflight_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """create_branch_protection_rule_preflight # noqa: E501 + """ # noqa: E501 + + _param = self._create_branch_protection_rule_preflight_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_branch_protection_rule_preflight_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """create_branch_protection_rule_preflight - >>> thread = api.create_branch_protection_rule_preflight_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_branch_protection_rule_preflight_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_branch_protection_rule_preflight_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create_branch_protection_rule_preflight + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_branch_protection_rule_preflight_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_branch_protection_rule_preflight" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _create_branch_protection_rule_preflight_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branch_protection/set_allowed', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branch_protection/set_allowed', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_commit_record(self, repository : StrictStr, commit_record_creation : CommitRecordCreation, **kwargs) -> None: # noqa: E501 - """create commit record # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_commit_record(repository, commit_record_creation, async_req=True) - >>> result = thread.get() + @validate_call + def create_commit_record( + self, + repository: StrictStr, + commit_record_creation: CommitRecordCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """create commit record + :param repository: (required) :type repository: str :param commit_record_creation: (required) :type commit_record_creation: CommitRecordCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_commit_record_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_commit_record_with_http_info(repository, commit_record_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_commit_record_with_http_info(self, repository : StrictStr, commit_record_creation : CommitRecordCreation, **kwargs) -> ApiResponse: # noqa: E501 - """create commit record # noqa: E501 + """ # noqa: E501 + + _param = self._create_commit_record_serialize( + repository=repository, + commit_record_creation=commit_record_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_commit_record_with_http_info( + self, + repository: StrictStr, + commit_record_creation: CommitRecordCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """create commit record - >>> thread = api.create_commit_record_with_http_info(repository, commit_record_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param commit_record_creation: (required) :type commit_record_creation: CommitRecordCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_commit_record_serialize( + repository=repository, + commit_record_creation=commit_record_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'commit_record_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_commit_record_without_preload_content( + self, + repository: StrictStr, + commit_record_creation: CommitRecordCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create commit record + + + :param repository: (required) + :type repository: str + :param commit_record_creation: (required) + :type commit_record_creation: CommitRecordCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_commit_record_serialize( + repository=repository, + commit_record_creation=commit_record_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_commit_record" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _create_commit_record_serialize( + self, + repository, + commit_record_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['commit_record_creation'] is not None: - _body_params = _params['commit_record_creation'] + if commit_record_creation is not None: + _body_params = commit_record_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/commits', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/commits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_symlink_file(self, repository : StrictStr, branch : StrictStr, location : Annotated[Optional[StrictStr], Field(description="path to the table data")] = None, **kwargs) -> StorageURI: # noqa: E501 - """creates symlink files corresponding to the given directory # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_symlink_file(repository, branch, location, async_req=True) - >>> result = thread.get() + @validate_call + def create_symlink_file( + self, + repository: StrictStr, + branch: StrictStr, + location: Annotated[Optional[StrictStr], Field(description="path to the table data")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StorageURI: + """creates symlink files corresponding to the given directory + :param repository: (required) :type repository: str @@ -376,31 +672,76 @@ def create_symlink_file(self, repository : StrictStr, branch : StrictStr, locati :type branch: str :param location: path to the table data :type location: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StorageURI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_symlink_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_symlink_file_with_http_info(repository, branch, location, **kwargs) # noqa: E501 - - @validate_arguments - def create_symlink_file_with_http_info(self, repository : StrictStr, branch : StrictStr, location : Annotated[Optional[StrictStr], Field(description="path to the table data")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """creates symlink files corresponding to the given directory # noqa: E501 + """ # noqa: E501 + + _param = self._create_symlink_file_serialize( + repository=repository, + branch=branch, + location=location, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_symlink_file_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + location: Annotated[Optional[StrictStr], Field(description="path to the table data")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StorageURI]: + """creates symlink files corresponding to the given directory - >>> thread = api.create_symlink_file_with_http_info(repository, branch, location, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -408,812 +749,1541 @@ def create_symlink_file_with_http_info(self, repository : StrictStr, branch : St :type branch: str :param location: path to the table data :type location: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StorageURI, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_symlink_file_serialize( + repository=repository, + branch=branch, + location=location, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'branch', - 'location' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_symlink_file_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + location: Annotated[Optional[StrictStr], Field(description="path to the table data")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """creates symlink files corresponding to the given directory + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param location: path to the table data + :type location: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_symlink_file_serialize( + repository=repository, + branch=branch, + location=location, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_symlink_file" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _create_symlink_file_serialize( + self, + repository, + branch, + location, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('location') is not None: # noqa: E501 - _query_params.append(('location', _params['location'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if location is not None: + + _query_params.append(('location', location)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '201': "StorageURI", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{branch}/symlink', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/refs/{branch}/symlink', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_repository_metadata(self, repository : StrictStr, repository_metadata_keys : RepositoryMetadataKeys, **kwargs) -> None: # noqa: E501 - """delete repository metadata # noqa: E501 - Delete specified keys from the repository's metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_repository_metadata(repository, repository_metadata_keys, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_repository_metadata( + self, + repository: StrictStr, + repository_metadata_keys: RepositoryMetadataKeys, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete repository metadata + + Delete specified keys from the repository's metadata. :param repository: (required) :type repository: str :param repository_metadata_keys: (required) :type repository_metadata_keys: RepositoryMetadataKeys - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_repository_metadata_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_repository_metadata_with_http_info(repository, repository_metadata_keys, **kwargs) # noqa: E501 - - @validate_arguments - def delete_repository_metadata_with_http_info(self, repository : StrictStr, repository_metadata_keys : RepositoryMetadataKeys, **kwargs) -> ApiResponse: # noqa: E501 - """delete repository metadata # noqa: E501 - - Delete specified keys from the repository's metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_repository_metadata_with_http_info(repository, repository_metadata_keys, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_repository_metadata_serialize( + repository=repository, + repository_metadata_keys=repository_metadata_keys, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_repository_metadata_with_http_info( + self, + repository: StrictStr, + repository_metadata_keys: RepositoryMetadataKeys, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete repository metadata + + Delete specified keys from the repository's metadata. :param repository: (required) :type repository: str :param repository_metadata_keys: (required) :type repository_metadata_keys: RepositoryMetadataKeys - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_repository_metadata_serialize( + repository=repository, + repository_metadata_keys=repository_metadata_keys, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'repository_metadata_keys' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_repository_metadata_without_preload_content( + self, + repository: StrictStr, + repository_metadata_keys: RepositoryMetadataKeys, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete repository metadata + + Delete specified keys from the repository's metadata. + + :param repository: (required) + :type repository: str + :param repository_metadata_keys: (required) + :type repository_metadata_keys: RepositoryMetadataKeys + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_repository_metadata_serialize( + repository=repository, + repository_metadata_keys=repository_metadata_keys, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_repository_metadata" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _delete_repository_metadata_serialize( + self, + repository, + repository_metadata_keys, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['repository_metadata_keys'] is not None: - _body_params = _params['repository_metadata_keys'] + if repository_metadata_keys is not None: + _body_params = repository_metadata_keys + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/metadata', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def dump_refs(self, repository : StrictStr, **kwargs) -> RefsDump: # noqa: E501 - """Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.dump_refs(repository, async_req=True) - >>> result = thread.get() + + @validate_call + def dump_refs( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RefsDump: + """Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: RefsDump - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the dump_refs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.dump_refs_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def dump_refs_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations # noqa: E501 + """ # noqa: E501 + + _param = self._dump_refs_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "RefsDump", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def dump_refs_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RefsDump]: + """Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations - >>> thread = api.dump_refs_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(RefsDump, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._dump_refs_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method dump_refs" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '201': "RefsDump", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def dump_refs_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._dump_refs_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '201': "RefsDump", '400': "Error", '401': "Error", '404': "Error", '420': None, } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _dump_refs_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/dump', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/refs/dump', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_auth_capabilities(self, **kwargs) -> AuthCapabilities: # noqa: E501 - """list authentication capabilities supported # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_auth_capabilities(async_req=True) - >>> result = thread.get() + @validate_call + def get_auth_capabilities( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthCapabilities: + """list authentication capabilities supported + - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AuthCapabilities - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_auth_capabilities_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_auth_capabilities_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_auth_capabilities_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """list authentication capabilities supported # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_auth_capabilities_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._get_auth_capabilities_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthCapabilities", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_auth_capabilities_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthCapabilities]: + """list authentication capabilities supported + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AuthCapabilities, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._get_auth_capabilities_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthCapabilities", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_auth_capabilities_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list authentication capabilities supported + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_auth_capabilities_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_auth_capabilities" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthCapabilities", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_auth_capabilities_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AuthCapabilities", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/auth/capabilities', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/auth/capabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_garbage_collection_config(self, **kwargs) -> GarbageCollectionConfig: # noqa: E501 - """get_garbage_collection_config # noqa: E501 - get information of gc settings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_garbage_collection_config(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def get_garbage_collection_config( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GarbageCollectionConfig: + """get_garbage_collection_config + + get information of gc settings + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GarbageCollectionConfig - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_garbage_collection_config_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_garbage_collection_config_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_garbage_collection_config_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get_garbage_collection_config # noqa: E501 - - get information of gc settings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_garbage_collection_config_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._get_garbage_collection_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_garbage_collection_config_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GarbageCollectionConfig]: + """get_garbage_collection_config + + get information of gc settings + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GarbageCollectionConfig, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._get_garbage_collection_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_garbage_collection_config_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_garbage_collection_config + + get information of gc settings + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_garbage_collection_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_garbage_collection_config" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_garbage_collection_config_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "GarbageCollectionConfig", - '401': "Error", - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/config/garbage-collection', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/config/garbage-collection', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_lake_fs_version(self, **kwargs) -> VersionConfig: # noqa: E501 - """(Deprecated) get_lake_fs_version # noqa: E501 - get version of lakeFS server # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_lake_fs_version(async_req=True) - >>> result = thread.get() + @validate_call + def get_lake_fs_version( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VersionConfig: + """(Deprecated) get_lake_fs_version + + get version of lakeFS server - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: VersionConfig - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_lake_fs_version_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_lake_fs_version_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_lake_fs_version_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) get_lake_fs_version # noqa: E501 - - get version of lakeFS server # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_lake_fs_version_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + warnings.warn("GET /config/version is deprecated.", DeprecationWarning) + + _param = self._get_lake_fs_version_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VersionConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_lake_fs_version_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VersionConfig]: + """(Deprecated) get_lake_fs_version + + get version of lakeFS server + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(VersionConfig, status_code(int), headers(HTTPHeaderDict)) - """ - + """ # noqa: E501 warnings.warn("GET /config/version is deprecated.", DeprecationWarning) - _params = locals() + _param = self._get_lake_fs_version_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VersionConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_lake_fs_version_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) get_lake_fs_version + + get version of lakeFS server + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /config/version is deprecated.", DeprecationWarning) + + _param = self._get_lake_fs_version_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_lake_fs_version" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "VersionConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _get_lake_fs_version_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "VersionConfig", - '401': "Error", - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/config/version', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/config/version', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_metadata_object(self, repository : StrictStr, object_id : StrictStr, type : StrictStr, presign : Optional[StrictBool] = None, **kwargs) -> bytearray: # noqa: E501 - """return a lakeFS metadata object by ID # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_metadata_object(repository, object_id, type, presign, async_req=True) - >>> result = thread.get() + @validate_call + def get_metadata_object( + self, + repository: StrictStr, + object_id: StrictStr, + type: StrictStr, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """return a lakeFS metadata object by ID + :param repository: (required) :type repository: str @@ -1223,31 +2293,79 @@ def get_metadata_object(self, repository : StrictStr, object_id : StrictStr, typ :type type: str :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bytearray - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_metadata_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_metadata_object_with_http_info(repository, object_id, type, presign, **kwargs) # noqa: E501 - - @validate_arguments - def get_metadata_object_with_http_info(self, repository : StrictStr, object_id : StrictStr, type : StrictStr, presign : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """return a lakeFS metadata object by ID # noqa: E501 + """ # noqa: E501 + + _param = self._get_metadata_object_serialize( + repository=repository, + object_id=object_id, + type=type, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '302': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_metadata_object_with_http_info( + self, + repository: StrictStr, + object_id: StrictStr, + type: StrictStr, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """return a lakeFS metadata object by ID - >>> thread = api.get_metadata_object_with_http_info(repository, object_id, type, presign, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1257,2568 +2375,4986 @@ def get_metadata_object_with_http_info(self, repository : StrictStr, object_id : :type type: str :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'object_id', - 'type', - 'presign' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_metadata_object_serialize( + repository=repository, + object_id=object_id, + type=type, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_metadata_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '302': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - if _params['object_id']: - _path_params['object_id'] = _params['object_id'] + @validate_call + def get_metadata_object_without_preload_content( + self, + repository: StrictStr, + object_id: StrictStr, + type: StrictStr, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """return a lakeFS metadata object by ID - if _params['type']: - _path_params['type'] = _params['type'] + + :param repository: (required) + :type repository: str + :param object_id: (required) + :type object_id: str + :param type: (required) + :type type: str + :param presign: + :type presign: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metadata_object_serialize( + repository=repository, + object_id=object_id, + type=type, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '302': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_metadata_object_serialize( + self, + repository, + object_id, + type, + presign, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if object_id is not None: + _path_params['object_id'] = object_id + if type is not None: + _path_params['type'] = type + # process the query parameters + if presign is not None: + + _query_params.append(('presign', presign)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/octet-stream', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/metadata/object/{type}/{object_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_setup_state( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SetupState: + """check if the lakeFS installation is already set up + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_setup_state_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SetupState", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_setup_state_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SetupState]: + """check if the lakeFS installation is already set up + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_setup_state_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SetupState", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_setup_state_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """check if the lakeFS installation is already set up + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_setup_state_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SetupState", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_setup_state_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/setup_lakefs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_storage_config( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StorageConfig: + """(Deprecated) get_storage_config + + retrieve lakeFS storage configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /config/storage is deprecated.", DeprecationWarning) + + _param = self._get_storage_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_storage_config_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StorageConfig]: + """(Deprecated) get_storage_config + + retrieve lakeFS storage configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /config/storage is deprecated.", DeprecationWarning) + + _param = self._get_storage_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_storage_config_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) get_storage_config + + retrieve lakeFS storage configuration + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /config/storage is deprecated.", DeprecationWarning) + + _param = self._get_storage_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageConfig", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_storage_config_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/config/storage', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_usage_report_summary( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InstallationUsageReport: + """get usage report summary + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_usage_report_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InstallationUsageReport", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_usage_report_summary_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InstallationUsageReport]: + """get usage report summary + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_usage_report_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InstallationUsageReport", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_usage_report_summary_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get usage report summary + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_usage_report_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InstallationUsageReport", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + def _get_usage_report_summary_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] - if _params.get('presign') is not None: # noqa: E501 - _query_params.append(('presign', _params['presign'])) + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/text' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + return self.api_client.param_serialize( + method='GET', + resource_path='/usage-report/summary', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def internal_create_branch_protection_rule( + self, + repository: StrictStr, + branch_protection_rule: BranchProtectionRule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """(Deprecated) internal_create_branch_protection_rule + + + :param repository: (required) + :type repository: str + :param branch_protection_rule: (required) + :type branch_protection_rule: BranchProtectionRule + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) + + _param = self._internal_create_branch_protection_rule_serialize( + repository=repository, + branch_protection_rule=branch_protection_rule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def internal_create_branch_protection_rule_with_http_info( + self, + repository: StrictStr, + branch_protection_rule: BranchProtectionRule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """(Deprecated) internal_create_branch_protection_rule + + + :param repository: (required) + :type repository: str + :param branch_protection_rule: (required) + :type branch_protection_rule: BranchProtectionRule + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) + + _param = self._internal_create_branch_protection_rule_serialize( + repository=repository, + branch_protection_rule=branch_protection_rule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def internal_create_branch_protection_rule_without_preload_content( + self, + repository: StrictStr, + branch_protection_rule: BranchProtectionRule, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) internal_create_branch_protection_rule + + + :param repository: (required) + :type repository: str + :param branch_protection_rule: (required) + :type branch_protection_rule: BranchProtectionRule + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) + + _param = self._internal_create_branch_protection_rule_serialize( + repository=repository, + branch_protection_rule=branch_protection_rule, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _internal_create_branch_protection_rule_serialize( + self, + repository, + branch_protection_rule, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + if branch_protection_rule is not None: + _body_params = branch_protection_rule + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream', 'application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branch_protection', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def internal_delete_branch_protection_rule( + self, + repository: StrictStr, + internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """(Deprecated) internal_delete_branch_protection_rule + + + :param repository: (required) + :type repository: str + :param internal_delete_branch_protection_rule_request: (required) + :type internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("DELETE /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _param = self._internal_delete_branch_protection_rule_serialize( + repository=repository, + internal_delete_branch_protection_rule_request=internal_delete_branch_protection_rule_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { - '200': "bytearray", - '302': None, + _response_types_map: Dict[str, Optional[str]] = { + '204': None, '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories/{repository}/metadata/object/{type}/{object_id}', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def get_setup_state(self, **kwargs) -> SetupState: # noqa: E501 - """check if the lakeFS installation is already set up # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def internal_delete_branch_protection_rule_with_http_info( + self, + repository: StrictStr, + internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """(Deprecated) internal_delete_branch_protection_rule - >>> thread = api.get_setup_state(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: SetupState - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_setup_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_setup_state_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_setup_state_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """check if the lakeFS installation is already set up # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_setup_state_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param repository: (required) + :type repository: str + :param internal_delete_branch_protection_rule_request: (required) + :type internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(SetupState, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + warnings.warn("DELETE /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _param = self._internal_delete_branch_protection_rule_serialize( + repository=repository, + internal_delete_branch_protection_rule_request=internal_delete_branch_protection_rule_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_setup_state" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "SetupState", + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", '420': None, } - - return self.api_client.call_api( - '/setup_lakefs', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + ) - @validate_arguments - def get_storage_config(self, **kwargs) -> StorageConfig: # noqa: E501 - """(Deprecated) get_storage_config # noqa: E501 - retrieve lakeFS storage configuration # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def internal_delete_branch_protection_rule_without_preload_content( + self, + repository: StrictStr, + internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) internal_delete_branch_protection_rule - >>> thread = api.get_storage_config(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StorageConfig - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_storage_config_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_storage_config_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_storage_config_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) get_storage_config # noqa: E501 - - retrieve lakeFS storage configuration # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_storage_config_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param repository: (required) + :type repository: str + :param internal_delete_branch_protection_rule_request: (required) + :type internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StorageConfig, status_code(int), headers(HTTPHeaderDict)) - """ - - warnings.warn("GET /config/storage is deprecated.", DeprecationWarning) + """ # noqa: E501 + warnings.warn("DELETE /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) - _params = locals() + _param = self._internal_delete_branch_protection_rule_serialize( + repository=repository, + internal_delete_branch_protection_rule_request=internal_delete_branch_protection_rule_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_storage_config" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _internal_delete_branch_protection_rule_serialize( + self, + repository, + internal_delete_branch_protection_rule_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + if internal_delete_branch_protection_rule_request is not None: + _body_params = internal_delete_branch_protection_rule_request + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - _response_types_map = { - '200': "StorageConfig", - '401': "Error", - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/config/storage', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/branch_protection', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_usage_report_summary(self, **kwargs) -> InstallationUsageReport: # noqa: E501 - """get usage report summary # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_usage_report_summary(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: InstallationUsageReport - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_usage_report_summary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_usage_report_summary_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_usage_report_summary_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """get usage report summary # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_usage_report_summary_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + @validate_call + def internal_delete_garbage_collection_rules( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """(Deprecated) internal_delete_garbage_collection_rules + + + :param repository: (required) + :type repository: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(InstallationUsageReport, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + warnings.warn("DELETE /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _param = self._internal_delete_garbage_collection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_usage_report_summary" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/text']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "InstallationUsageReport", - '400': "Error", + _response_types_map: Dict[str, Optional[str]] = { + '204': None, '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/usage-report/summary', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def internal_create_branch_protection_rule(self, repository : StrictStr, branch_protection_rule : BranchProtectionRule, **kwargs) -> None: # noqa: E501 - """(Deprecated) internal_create_branch_protection_rule # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def internal_delete_garbage_collection_rules_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """(Deprecated) internal_delete_garbage_collection_rules - >>> thread = api.internal_create_branch_protection_rule(repository, branch_protection_rule, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param branch_protection_rule: (required) - :type branch_protection_rule: BranchProtectionRule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the internal_create_branch_protection_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.internal_create_branch_protection_rule_with_http_info(repository, branch_protection_rule, **kwargs) # noqa: E501 + """ # noqa: E501 + warnings.warn("DELETE /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + + _param = self._internal_delete_garbage_collection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def internal_create_branch_protection_rule_with_http_info(self, repository : StrictStr, branch_protection_rule : BranchProtectionRule, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) internal_create_branch_protection_rule # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def internal_delete_garbage_collection_rules_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) internal_delete_garbage_collection_rules - >>> thread = api.internal_create_branch_protection_rule_with_http_info(repository, branch_protection_rule, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param branch_protection_rule: (required) - :type branch_protection_rule: BranchProtectionRule - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - warnings.warn("POST /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) + """ # noqa: E501 + warnings.warn("DELETE /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) - _params = locals() + _param = self._internal_delete_garbage_collection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository', - 'branch_protection_rule' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method internal_create_branch_protection_rule" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _internal_delete_garbage_collection_rules_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['branch_protection_rule'] is not None: - _body_params = _params['branch_protection_rule'] + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branch_protection', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/gc/rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def internal_delete_branch_protection_rule(self, repository : StrictStr, internal_delete_branch_protection_rule_request : InternalDeleteBranchProtectionRuleRequest, **kwargs) -> None: # noqa: E501 - """(Deprecated) internal_delete_branch_protection_rule # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.internal_delete_branch_protection_rule(repository, internal_delete_branch_protection_rule_request, async_req=True) - >>> result = thread.get() + @validate_call + def internal_get_branch_protection_rules( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[BranchProtectionRule]: + """(Deprecated) get branch protection rules + :param repository: (required) :type repository: str - :param internal_delete_branch_protection_rule_request: (required) - :type internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the internal_delete_branch_protection_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.internal_delete_branch_protection_rule_with_http_info(repository, internal_delete_branch_protection_rule_request, **kwargs) # noqa: E501 + """ # noqa: E501 + warnings.warn("GET /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) - @validate_arguments - def internal_delete_branch_protection_rule_with_http_info(self, repository : StrictStr, internal_delete_branch_protection_rule_request : InternalDeleteBranchProtectionRuleRequest, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) internal_delete_branch_protection_rule # noqa: E501 + _param = self._internal_get_branch_protection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BranchProtectionRule]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def internal_get_branch_protection_rules_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[BranchProtectionRule]]: + """(Deprecated) get branch protection rules - >>> thread = api.internal_delete_branch_protection_rule_with_http_info(repository, internal_delete_branch_protection_rule_request, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param internal_delete_branch_protection_rule_request: (required) - :type internal_delete_branch_protection_rule_request: InternalDeleteBranchProtectionRuleRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + warnings.warn("GET /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) - warnings.warn("DELETE /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) + _param = self._internal_get_branch_protection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BranchProtectionRule]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'internal_delete_branch_protection_rule_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def internal_get_branch_protection_rules_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) get branch protection rules + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) + + _param = self._internal_get_branch_protection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method internal_delete_branch_protection_rule" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BranchProtectionRule]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _internal_get_branch_protection_rules_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['internal_delete_branch_protection_rule_request'] is not None: - _body_params = _params['internal_delete_branch_protection_rule_request'] + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branch_protection', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branch_protection', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def internal_get_garbage_collection_rules( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GarbageCollectionRules: + """(Deprecated) internal_get_garbage_collection_rules + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + + _param = self._internal_get_garbage_collection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionRules", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def internal_delete_garbage_collection_rules(self, repository : StrictStr, **kwargs) -> None: # noqa: E501 - """(Deprecated) internal_delete_garbage_collection_rules # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def internal_get_garbage_collection_rules_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GarbageCollectionRules]: + """(Deprecated) internal_get_garbage_collection_rules - >>> thread = api.internal_delete_garbage_collection_rules(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the internal_delete_garbage_collection_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.internal_delete_garbage_collection_rules_with_http_info(repository, **kwargs) # noqa: E501 + """ # noqa: E501 + warnings.warn("GET /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + + _param = self._internal_get_garbage_collection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionRules", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def internal_delete_garbage_collection_rules_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) internal_delete_garbage_collection_rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def internal_get_garbage_collection_rules_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) internal_get_garbage_collection_rules - >>> thread = api.internal_delete_garbage_collection_rules_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - warnings.warn("DELETE /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + """ # noqa: E501 + warnings.warn("GET /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) - _params = locals() + _param = self._internal_get_garbage_collection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionRules", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method internal_delete_garbage_collection_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _internal_get_garbage_collection_rules_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/gc/rules', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/gc/rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def internal_get_branch_protection_rules(self, repository : StrictStr, **kwargs) -> List[BranchProtectionRule]: # noqa: E501 - """(Deprecated) get branch protection rules # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.internal_get_branch_protection_rules(repository, async_req=True) - >>> result = thread.get() - :param repository: (required) - :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[BranchProtectionRule] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the internal_get_branch_protection_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.internal_get_branch_protection_rules_with_http_info(repository, **kwargs) # noqa: E501 - @validate_arguments - def internal_get_branch_protection_rules_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) get branch protection rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def internal_set_garbage_collection_rules( + self, + repository: StrictStr, + garbage_collection_rules: GarbageCollectionRules, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """(Deprecated) internal_set_garbage_collection_rules - >>> thread = api.internal_get_branch_protection_rules_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param garbage_collection_rules: (required) + :type garbage_collection_rules: GarbageCollectionRules :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[BranchProtectionRule], status_code(int), headers(HTTPHeaderDict)) - """ - - warnings.warn("GET /repositories/{repository}/branch_protection is deprecated.", DeprecationWarning) - - _params = locals() + """ # noqa: E501 + warnings.warn("POST /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _param = self._internal_set_garbage_collection_rules_serialize( + repository=repository, + garbage_collection_rules=garbage_collection_rules, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method internal_get_branch_protection_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "List[BranchProtectionRule]", + _response_types_map: Dict[str, Optional[str]] = { + '204': None, '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories/{repository}/branch_protection', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def internal_get_garbage_collection_rules(self, repository : StrictStr, **kwargs) -> GarbageCollectionRules: # noqa: E501 - """(Deprecated) internal_get_garbage_collection_rules # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def internal_set_garbage_collection_rules_with_http_info( + self, + repository: StrictStr, + garbage_collection_rules: GarbageCollectionRules, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """(Deprecated) internal_set_garbage_collection_rules - >>> thread = api.internal_get_garbage_collection_rules(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param garbage_collection_rules: (required) + :type garbage_collection_rules: GarbageCollectionRules :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GarbageCollectionRules - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the internal_get_garbage_collection_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.internal_get_garbage_collection_rules_with_http_info(repository, **kwargs) # noqa: E501 + """ # noqa: E501 + warnings.warn("POST /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + + _param = self._internal_set_garbage_collection_rules_serialize( + repository=repository, + garbage_collection_rules=garbage_collection_rules, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def internal_get_garbage_collection_rules_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) internal_get_garbage_collection_rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def internal_set_garbage_collection_rules_without_preload_content( + self, + repository: StrictStr, + garbage_collection_rules: GarbageCollectionRules, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) internal_set_garbage_collection_rules - >>> thread = api.internal_get_garbage_collection_rules_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param garbage_collection_rules: (required) + :type garbage_collection_rules: GarbageCollectionRules :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GarbageCollectionRules, status_code(int), headers(HTTPHeaderDict)) - """ - - warnings.warn("GET /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + """ # noqa: E501 + warnings.warn("POST /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) - _params = locals() + _param = self._internal_set_garbage_collection_rules_serialize( + repository=repository, + garbage_collection_rules=garbage_collection_rules, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method internal_get_garbage_collection_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _internal_set_garbage_collection_rules_serialize( + self, + repository, + garbage_collection_rules, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + if garbage_collection_rules is not None: + _body_params = garbage_collection_rules + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - _response_types_map = { - '200': "GarbageCollectionRules", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/gc/rules', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/gc/rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def internal_set_garbage_collection_rules(self, repository : StrictStr, garbage_collection_rules : GarbageCollectionRules, **kwargs) -> None: # noqa: E501 - """(Deprecated) internal_set_garbage_collection_rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.internal_set_garbage_collection_rules(repository, garbage_collection_rules, async_req=True) - >>> result = thread.get() - :param repository: (required) - :type repository: str - :param garbage_collection_rules: (required) - :type garbage_collection_rules: GarbageCollectionRules - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def post_stats_events( + self, + stats_events_list: StatsEventsList, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """post stats events, this endpoint is meant for internal use only + + + :param stats_events_list: (required) + :type stats_events_list: StatsEventsList :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the internal_set_garbage_collection_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.internal_set_garbage_collection_rules_with_http_info(repository, garbage_collection_rules, **kwargs) # noqa: E501 - - @validate_arguments - def internal_set_garbage_collection_rules_with_http_info(self, repository : StrictStr, garbage_collection_rules : GarbageCollectionRules, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) internal_set_garbage_collection_rules # noqa: E501 + """ # noqa: E501 + + _param = self._post_stats_events_serialize( + stats_events_list=stats_events_list, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def post_stats_events_with_http_info( + self, + stats_events_list: StatsEventsList, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """post stats events, this endpoint is meant for internal use only - >>> thread = api.internal_set_garbage_collection_rules_with_http_info(repository, garbage_collection_rules, async_req=True) - >>> result = thread.get() - :param repository: (required) - :type repository: str - :param garbage_collection_rules: (required) - :type garbage_collection_rules: GarbageCollectionRules - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param stats_events_list: (required) + :type stats_events_list: StatsEventsList :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._post_stats_events_serialize( + stats_events_list=stats_events_list, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - warnings.warn("POST /repositories/{repository}/gc/rules is deprecated.", DeprecationWarning) + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'garbage_collection_rules' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def post_stats_events_without_preload_content( + self, + stats_events_list: StatsEventsList, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """post stats events, this endpoint is meant for internal use only + + + :param stats_events_list: (required) + :type stats_events_list: StatsEventsList + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_stats_events_serialize( + stats_events_list=stats_events_list, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method internal_set_garbage_collection_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _post_stats_events_serialize( + self, + stats_events_list, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['garbage_collection_rules'] is not None: - _body_params = _params['garbage_collection_rules'] + if stats_events_list is not None: + _body_params = stats_events_list + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/gc/rules', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/statistics', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def post_stats_events(self, stats_events_list : StatsEventsList, **kwargs) -> None: # noqa: E501 - """post stats events, this endpoint is meant for internal use only # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.post_stats_events(stats_events_list, async_req=True) - >>> result = thread.get() - :param stats_events_list: (required) - :type stats_events_list: StatsEventsList - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def prepare_garbage_collection_commits( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GarbageCollectionPrepareResponse: + """save lists of active commits for garbage collection + + + :param repository: (required) + :type repository: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the post_stats_events_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.post_stats_events_with_http_info(stats_events_list, **kwargs) # noqa: E501 - - @validate_arguments - def post_stats_events_with_http_info(self, stats_events_list : StatsEventsList, **kwargs) -> ApiResponse: # noqa: E501 - """post stats events, this endpoint is meant for internal use only # noqa: E501 + """ # noqa: E501 + + _param = self._prepare_garbage_collection_commits_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "GarbageCollectionPrepareResponse", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def prepare_garbage_collection_commits_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GarbageCollectionPrepareResponse]: + """save lists of active commits for garbage collection - >>> thread = api.post_stats_events_with_http_info(stats_events_list, async_req=True) - >>> result = thread.get() - :param stats_events_list: (required) - :type stats_events_list: StatsEventsList - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param repository: (required) + :type repository: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._prepare_garbage_collection_commits_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "GarbageCollectionPrepareResponse", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'stats_events_list' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def prepare_garbage_collection_commits_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """save lists of active commits for garbage collection + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._prepare_garbage_collection_commits_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "GarbageCollectionPrepareResponse", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response + + + def _prepare_garbage_collection_commits_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method post_stats_events" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _collection_formats: Dict[str, str] = { + } - _collection_formats = {} + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['stats_events_list'] is not None: - _body_params = _params['stats_events_list'] + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/statistics', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/gc/prepare_commits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def prepare_garbage_collection_commits(self, repository : StrictStr, **kwargs) -> GarbageCollectionPrepareResponse: # noqa: E501 - """save lists of active commits for garbage collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.prepare_garbage_collection_commits(repository, async_req=True) - >>> result = thread.get() - :param repository: (required) - :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GarbageCollectionPrepareResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the prepare_garbage_collection_commits_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.prepare_garbage_collection_commits_with_http_info(repository, **kwargs) # noqa: E501 - @validate_arguments - def prepare_garbage_collection_commits_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """save lists of active commits for garbage collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def prepare_garbage_collection_uncommitted( + self, + repository: StrictStr, + prepare_gc_uncommitted_request: Optional[PrepareGCUncommittedRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PrepareGCUncommittedResponse: + """save repository uncommitted metadata for garbage collection - >>> thread = api.prepare_garbage_collection_commits_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param prepare_gc_uncommitted_request: + :type prepare_gc_uncommitted_request: PrepareGCUncommittedRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GarbageCollectionPrepareResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._prepare_garbage_collection_uncommitted_serialize( + repository=repository, + prepare_gc_uncommitted_request=prepare_gc_uncommitted_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method prepare_garbage_collection_commits" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "GarbageCollectionPrepareResponse", + _response_types_map: Dict[str, Optional[str]] = { + '201': "PrepareGCUncommittedResponse", + '400': "Error", '401': "Error", '403': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories/{repository}/gc/prepare_commits', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def prepare_garbage_collection_uncommitted(self, repository : StrictStr, prepare_gc_uncommitted_request : Optional[PrepareGCUncommittedRequest] = None, **kwargs) -> PrepareGCUncommittedResponse: # noqa: E501 - """save repository uncommitted metadata for garbage collection # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def prepare_garbage_collection_uncommitted_with_http_info( + self, + repository: StrictStr, + prepare_gc_uncommitted_request: Optional[PrepareGCUncommittedRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PrepareGCUncommittedResponse]: + """save repository uncommitted metadata for garbage collection - >>> thread = api.prepare_garbage_collection_uncommitted(repository, prepare_gc_uncommitted_request, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param prepare_gc_uncommitted_request: :type prepare_gc_uncommitted_request: PrepareGCUncommittedRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PrepareGCUncommittedResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the prepare_garbage_collection_uncommitted_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.prepare_garbage_collection_uncommitted_with_http_info(repository, prepare_gc_uncommitted_request, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._prepare_garbage_collection_uncommitted_serialize( + repository=repository, + prepare_gc_uncommitted_request=prepare_gc_uncommitted_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PrepareGCUncommittedResponse", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def prepare_garbage_collection_uncommitted_with_http_info(self, repository : StrictStr, prepare_gc_uncommitted_request : Optional[PrepareGCUncommittedRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """save repository uncommitted metadata for garbage collection # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def prepare_garbage_collection_uncommitted_without_preload_content( + self, + repository: StrictStr, + prepare_gc_uncommitted_request: Optional[PrepareGCUncommittedRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """save repository uncommitted metadata for garbage collection - >>> thread = api.prepare_garbage_collection_uncommitted_with_http_info(repository, prepare_gc_uncommitted_request, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param prepare_gc_uncommitted_request: :type prepare_gc_uncommitted_request: PrepareGCUncommittedRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PrepareGCUncommittedResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._prepare_garbage_collection_uncommitted_serialize( + repository=repository, + prepare_gc_uncommitted_request=prepare_gc_uncommitted_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository', - 'prepare_gc_uncommitted_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '201': "PrepareGCUncommittedResponse", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method prepare_garbage_collection_uncommitted" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _prepare_garbage_collection_uncommitted_serialize( + self, + repository, + prepare_gc_uncommitted_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['prepare_gc_uncommitted_request'] is not None: - _body_params = _params['prepare_gc_uncommitted_request'] + if prepare_gc_uncommitted_request is not None: + _body_params = prepare_gc_uncommitted_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "PrepareGCUncommittedResponse", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/gc/prepare_uncommited', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/gc/prepare_uncommited', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def restore_refs(self, repository : StrictStr, refs_restore : RefsRestore, **kwargs) -> None: # noqa: E501 - """Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.restore_refs(repository, refs_restore, async_req=True) - >>> result = thread.get() + + @validate_call + def restore_refs( + self, + repository: StrictStr, + refs_restore: RefsRestore, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations + :param repository: (required) :type repository: str :param refs_restore: (required) :type refs_restore: RefsRestore - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the restore_refs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.restore_refs_with_http_info(repository, refs_restore, **kwargs) # noqa: E501 - - @validate_arguments - def restore_refs_with_http_info(self, repository : StrictStr, refs_restore : RefsRestore, **kwargs) -> ApiResponse: # noqa: E501 - """Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations # noqa: E501 + """ # noqa: E501 + + _param = self._restore_refs_serialize( + repository=repository, + refs_restore=refs_restore, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def restore_refs_with_http_info( + self, + repository: StrictStr, + refs_restore: RefsRestore, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations - >>> thread = api.restore_refs_with_http_info(repository, refs_restore, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param refs_restore: (required) :type refs_restore: RefsRestore - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._restore_refs_serialize( + repository=repository, + refs_restore=refs_restore, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'refs_restore' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def restore_refs_without_preload_content( + self, + repository: StrictStr, + refs_restore: RefsRestore, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations + + + :param repository: (required) + :type repository: str + :param refs_restore: (required) + :type refs_restore: RefsRestore + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restore_refs_serialize( + repository=repository, + refs_restore=refs_restore, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method restore_refs" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _restore_refs_serialize( + self, + repository, + refs_restore, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['refs_restore'] is not None: - _body_params = _params['refs_restore'] + if refs_restore is not None: + _body_params = refs_restore + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/restore', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/refs/restore', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def set_garbage_collection_rules_preflight(self, repository : StrictStr, **kwargs) -> None: # noqa: E501 - """set_garbage_collection_rules_preflight # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_garbage_collection_rules_preflight(repository, async_req=True) - >>> result = thread.get() + @validate_call + def set_garbage_collection_rules_preflight( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """set_garbage_collection_rules_preflight + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the set_garbage_collection_rules_preflight_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.set_garbage_collection_rules_preflight_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def set_garbage_collection_rules_preflight_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """set_garbage_collection_rules_preflight # noqa: E501 + """ # noqa: E501 + + _param = self._set_garbage_collection_rules_preflight_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def set_garbage_collection_rules_preflight_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """set_garbage_collection_rules_preflight - >>> thread = api.set_garbage_collection_rules_preflight_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._set_garbage_collection_rules_preflight_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def set_garbage_collection_rules_preflight_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """set_garbage_collection_rules_preflight + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_garbage_collection_rules_preflight_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method set_garbage_collection_rules_preflight" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _set_garbage_collection_rules_preflight_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/gc/rules/set_allowed', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/gc/rules/set_allowed', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def set_repository_metadata(self, repository : StrictStr, repository_metadata_set : RepositoryMetadataSet, **kwargs) -> None: # noqa: E501 - """set repository metadata # noqa: E501 - Set repository metadata. This will only add or update the provided keys, and will not remove any existing keys. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def set_repository_metadata( + self, + repository: StrictStr, + repository_metadata_set: RepositoryMetadataSet, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """set repository metadata - >>> thread = api.set_repository_metadata(repository, repository_metadata_set, async_req=True) - >>> result = thread.get() + Set repository metadata. This will only add or update the provided keys, and will not remove any existing keys. :param repository: (required) :type repository: str :param repository_metadata_set: (required) :type repository_metadata_set: RepositoryMetadataSet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the set_repository_metadata_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.set_repository_metadata_with_http_info(repository, repository_metadata_set, **kwargs) # noqa: E501 - - @validate_arguments - def set_repository_metadata_with_http_info(self, repository : StrictStr, repository_metadata_set : RepositoryMetadataSet, **kwargs) -> ApiResponse: # noqa: E501 - """set repository metadata # noqa: E501 - - Set repository metadata. This will only add or update the provided keys, and will not remove any existing keys. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.set_repository_metadata_with_http_info(repository, repository_metadata_set, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._set_repository_metadata_serialize( + repository=repository, + repository_metadata_set=repository_metadata_set, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def set_repository_metadata_with_http_info( + self, + repository: StrictStr, + repository_metadata_set: RepositoryMetadataSet, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """set repository metadata + + Set repository metadata. This will only add or update the provided keys, and will not remove any existing keys. :param repository: (required) :type repository: str :param repository_metadata_set: (required) :type repository_metadata_set: RepositoryMetadataSet - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._set_repository_metadata_serialize( + repository=repository, + repository_metadata_set=repository_metadata_set, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'repository_metadata_set' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def set_repository_metadata_without_preload_content( + self, + repository: StrictStr, + repository_metadata_set: RepositoryMetadataSet, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """set repository metadata + + Set repository metadata. This will only add or update the provided keys, and will not remove any existing keys. + + :param repository: (required) + :type repository: str + :param repository_metadata_set: (required) + :type repository_metadata_set: RepositoryMetadataSet + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_repository_metadata_serialize( + repository=repository, + repository_metadata_set=repository_metadata_set, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method set_repository_metadata" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _set_repository_metadata_serialize( + self, + repository, + repository_metadata_set, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['repository_metadata_set'] is not None: - _body_params = _params['repository_metadata_set'] + if repository_metadata_set is not None: + _body_params = repository_metadata_set + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/metadata', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def setup(self, setup : Setup, **kwargs) -> CredentialsWithSecret: # noqa: E501 - """setup lakeFS and create a first user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.setup(setup, async_req=True) - >>> result = thread.get() + @validate_call + def setup( + self, + setup: Setup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CredentialsWithSecret: + """setup lakeFS and create a first user + :param setup: (required) :type setup: Setup - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CredentialsWithSecret - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the setup_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.setup_with_http_info(setup, **kwargs) # noqa: E501 - - @validate_arguments - def setup_with_http_info(self, setup : Setup, **kwargs) -> ApiResponse: # noqa: E501 - """setup lakeFS and create a first user # noqa: E501 + """ # noqa: E501 + + _param = self._setup_serialize( + setup=setup, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialsWithSecret", + '400': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def setup_with_http_info( + self, + setup: Setup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CredentialsWithSecret]: + """setup lakeFS and create a first user - >>> thread = api.setup_with_http_info(setup, async_req=True) - >>> result = thread.get() :param setup: (required) :type setup: Setup - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CredentialsWithSecret, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._setup_serialize( + setup=setup, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialsWithSecret", + '400': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'setup' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def setup_without_preload_content( + self, + setup: Setup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """setup lakeFS and create a first user + + + :param setup: (required) + :type setup: Setup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._setup_serialize( + setup=setup, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method setup" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "CredentialsWithSecret", + '400': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _setup_serialize( + self, + setup, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['setup'] is not None: - _body_params = _params['setup'] + if setup is not None: + _body_params = setup + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "CredentialsWithSecret", - '400': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/setup_lakefs', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/setup_lakefs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def setup_comm_prefs(self, comm_prefs_input : CommPrefsInput, **kwargs) -> None: # noqa: E501 - """setup communications preferences # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def setup_comm_prefs( + self, + comm_prefs_input: CommPrefsInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """setup communications preferences - >>> thread = api.setup_comm_prefs(comm_prefs_input, async_req=True) - >>> result = thread.get() :param comm_prefs_input: (required) :type comm_prefs_input: CommPrefsInput - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the setup_comm_prefs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.setup_comm_prefs_with_http_info(comm_prefs_input, **kwargs) # noqa: E501 - - @validate_arguments - def setup_comm_prefs_with_http_info(self, comm_prefs_input : CommPrefsInput, **kwargs) -> ApiResponse: # noqa: E501 - """setup communications preferences # noqa: E501 + """ # noqa: E501 + + _param = self._setup_comm_prefs_serialize( + comm_prefs_input=comm_prefs_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '409': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def setup_comm_prefs_with_http_info( + self, + comm_prefs_input: CommPrefsInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """setup communications preferences - >>> thread = api.setup_comm_prefs_with_http_info(comm_prefs_input, async_req=True) - >>> result = thread.get() :param comm_prefs_input: (required) :type comm_prefs_input: CommPrefsInput - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._setup_comm_prefs_serialize( + comm_prefs_input=comm_prefs_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '409': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'comm_prefs_input' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def setup_comm_prefs_without_preload_content( + self, + comm_prefs_input: CommPrefsInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """setup communications preferences + + + :param comm_prefs_input: (required) + :type comm_prefs_input: CommPrefsInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._setup_comm_prefs_serialize( + comm_prefs_input=comm_prefs_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method setup_comm_prefs" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '409': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _setup_comm_prefs_serialize( + self, + comm_prefs_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['comm_prefs_input'] is not None: - _body_params = _params['comm_prefs_input'] + if comm_prefs_input is not None: + _body_params = comm_prefs_input + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/setup_comm_prefs', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/setup_comm_prefs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def stage_object(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], object_stage_creation : ObjectStageCreation, **kwargs) -> ObjectStats: # noqa: E501 - """(Deprecated) stage an object's metadata for the given branch # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.stage_object(repository, branch, path, object_stage_creation, async_req=True) - >>> result = thread.get() + + @validate_call + def stage_object( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + object_stage_creation: ObjectStageCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStats: + """(Deprecated) stage an object's metadata for the given branch + :param repository: (required) :type repository: str @@ -3828,31 +7364,81 @@ def stage_object(self, repository : StrictStr, branch : StrictStr, path : Annota :type path: str :param object_stage_creation: (required) :type object_stage_creation: ObjectStageCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStats - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the stage_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.stage_object_with_http_info(repository, branch, path, object_stage_creation, **kwargs) # noqa: E501 + """ # noqa: E501 + warnings.warn("PUT /repositories/{repository}/branches/{branch}/objects is deprecated.", DeprecationWarning) - @validate_arguments - def stage_object_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], object_stage_creation : ObjectStageCreation, **kwargs) -> ApiResponse: # noqa: E501 - """(Deprecated) stage an object's metadata for the given branch # noqa: E501 + _param = self._stage_object_serialize( + repository=repository, + branch=branch, + path=path, + object_stage_creation=object_stage_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def stage_object_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + object_stage_creation: ObjectStageCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStats]: + """(Deprecated) stage an object's metadata for the given branch - >>> thread = api.stage_object_with_http_info(repository, branch, path, object_stage_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -3862,138 +7448,250 @@ def stage_object_with_http_info(self, repository : StrictStr, branch : StrictStr :type path: str :param object_stage_creation: (required) :type object_stage_creation: ObjectStageCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) - """ - + """ # noqa: E501 warnings.warn("PUT /repositories/{repository}/branches/{branch}/objects is deprecated.", DeprecationWarning) - _params = locals() + _param = self._stage_object_serialize( + repository=repository, + branch=branch, + path=path, + object_stage_creation=object_stage_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository', - 'branch', - 'path', - 'object_stage_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def stage_object_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + object_stage_creation: ObjectStageCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) stage an object's metadata for the given branch + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param object_stage_creation: (required) + :type object_stage_creation: ObjectStageCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("PUT /repositories/{repository}/branches/{branch}/objects is deprecated.", DeprecationWarning) + + _param = self._stage_object_serialize( + repository=repository, + branch=branch, + path=path, + object_stage_creation=object_stage_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method stage_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _stage_object_serialize( + self, + repository, + branch, + path, + object_stage_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['object_stage_creation'] is not None: - _body_params = _params['object_stage_creation'] + if object_stage_creation is not None: + _body_params = object_stage_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "ObjectStats", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/objects', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/branches/{branch}/objects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def upload_object_preflight(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], **kwargs) -> None: # noqa: E501 - """upload_object_preflight # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def upload_object_preflight( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """upload_object_preflight - >>> thread = api.upload_object_preflight(repository, branch, path, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -4001,31 +7699,77 @@ def upload_object_preflight(self, repository : StrictStr, branch : StrictStr, pa :type branch: str :param path: relative to the branch (required) :type path: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the upload_object_preflight_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.upload_object_preflight_with_http_info(repository, branch, path, **kwargs) # noqa: E501 - - @validate_arguments - def upload_object_preflight_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], **kwargs) -> ApiResponse: # noqa: E501 - """upload_object_preflight # noqa: E501 + """ # noqa: E501 + + _param = self._upload_object_preflight_serialize( + repository=repository, + branch=branch, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def upload_object_preflight_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """upload_object_preflight - >>> thread = api.upload_object_preflight_with_http_info(repository, branch, path, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -4033,105 +7777,199 @@ def upload_object_preflight_with_http_info(self, repository : StrictStr, branch :type branch: str :param path: relative to the branch (required) :type path: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._upload_object_preflight_serialize( + repository=repository, + branch=branch, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch', - 'path' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def upload_object_preflight_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """upload_object_preflight + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_object_preflight_serialize( + repository=repository, + branch=branch, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_object_preflight" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _upload_object_preflight_serialize( + self, + repository, + branch, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['branch']: - _path_params['branch'] = _params['branch'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) - + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/objects/stage_allowed', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branches/{branch}/objects/stage_allowed', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/metadata_api.py b/clients/python/lakefs_sdk/api/metadata_api.py index b23da8cbe32..0e8cdf34d0a 100644 --- a/clients/python/lakefs_sdk/api/metadata_api.py +++ b/clients/python/lakefs_sdk/api/metadata_api.py @@ -12,336 +12,601 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: from pydantic.v1 import StrictStr except ImportError: from pydantic import StrictStr - from lakefs_sdk.models.storage_uri import StorageURI -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class MetadataApi(object): +class MetadataApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_meta_range(self, repository : StrictStr, meta_range : StrictStr, **kwargs) -> StorageURI: # noqa: E501 - """return URI to a meta-range file # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_meta_range( + self, + repository: StrictStr, + meta_range: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StorageURI: + """return URI to a meta-range file - >>> thread = api.get_meta_range(repository, meta_range, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param meta_range: (required) :type meta_range: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StorageURI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_meta_range_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_meta_range_with_http_info(repository, meta_range, **kwargs) # noqa: E501 - - @validate_arguments - def get_meta_range_with_http_info(self, repository : StrictStr, meta_range : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """return URI to a meta-range file # noqa: E501 + """ # noqa: E501 + + _param = self._get_meta_range_serialize( + repository=repository, + meta_range=meta_range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_meta_range_with_http_info( + self, + repository: StrictStr, + meta_range: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StorageURI]: + """return URI to a meta-range file - >>> thread = api.get_meta_range_with_http_info(repository, meta_range, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param meta_range: (required) :type meta_range: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StorageURI, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_meta_range_serialize( + repository=repository, + meta_range=meta_range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'meta_range' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_meta_range_without_preload_content( + self, + repository: StrictStr, + meta_range: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """return URI to a meta-range file + + + :param repository: (required) + :type repository: str + :param meta_range: (required) + :type meta_range: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_meta_range_serialize( + repository=repository, + meta_range=meta_range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_meta_range" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_meta_range_serialize( + self, + repository, + meta_range, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['meta_range']: - _path_params['meta_range'] = _params['meta_range'] + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if meta_range is not None: + _path_params['meta_range'] = meta_range # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "StorageURI", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/metadata/meta_range/{meta_range}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/metadata/meta_range/{meta_range}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_range(self, repository : StrictStr, range : StrictStr, **kwargs) -> StorageURI: # noqa: E501 - """return URI to a range file # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_range(repository, range, async_req=True) - >>> result = thread.get() + + @validate_call + def get_range( + self, + repository: StrictStr, + range: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StorageURI: + """return URI to a range file + :param repository: (required) :type repository: str :param range: (required) :type range: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StorageURI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_range_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_range_with_http_info(repository, range, **kwargs) # noqa: E501 - - @validate_arguments - def get_range_with_http_info(self, repository : StrictStr, range : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """return URI to a range file # noqa: E501 + """ # noqa: E501 + + _param = self._get_range_serialize( + repository=repository, + range=range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_range_with_http_info( + self, + repository: StrictStr, + range: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StorageURI]: + """return URI to a range file - >>> thread = api.get_range_with_http_info(repository, range, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param range: (required) :type range: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StorageURI, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_range_serialize( + repository=repository, + range=range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'range' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_range_without_preload_content( + self, + repository: StrictStr, + range: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """return URI to a range file + + + :param repository: (required) + :type repository: str + :param range: (required) + :type range: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_range_serialize( + repository=repository, + range=range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StorageURI", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_range" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _get_range_serialize( + self, + repository, + range, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None - if _params['range']: - _path_params['range'] = _params['range'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if range is not None: + _path_params['range'] = range # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "StorageURI", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/metadata/range/{range}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/metadata/range/{range}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/objects_api.py b/clients/python/lakefs_sdk/api/objects_api.py index 50c43248b80..bda1f78c626 100644 --- a/clients/python/lakefs_sdk/api/objects_api.py +++ b/clients/python/lakefs_sdk/api/objects_api.py @@ -12,24 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator + from pydantic.v1 import Field, StrictBool, StrictBytes, StrictStr, field_validator except ImportError: - from pydantic import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator - + from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator from typing import Optional, Union - +from typing_extensions import Annotated from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation from lakefs_sdk.models.object_error_list import ObjectErrorList from lakefs_sdk.models.object_stats import ObjectStats @@ -37,35 +33,46 @@ from lakefs_sdk.models.path_list import PathList from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class ObjectsApi(object): +class ObjectsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def copy_object(self, repository : StrictStr, branch : Annotated[StrictStr, Field(..., description="destination branch for the copy")], dest_path : Annotated[StrictStr, Field(..., description="destination path relative to the branch")], object_copy_creation : ObjectCopyCreation, **kwargs) -> ObjectStats: # noqa: E501 - """create a copy of an object # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def copy_object( + self, + repository: StrictStr, + branch: Annotated[StrictStr, Field(description="destination branch for the copy")], + dest_path: Annotated[StrictStr, Field(description="destination path relative to the branch")], + object_copy_creation: ObjectCopyCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStats: + """create a copy of an object - >>> thread = api.copy_object(repository, branch, dest_path, object_copy_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -75,31 +82,80 @@ def copy_object(self, repository : StrictStr, branch : Annotated[StrictStr, Fiel :type dest_path: str :param object_copy_creation: (required) :type object_copy_creation: ObjectCopyCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStats - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the copy_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.copy_object_with_http_info(repository, branch, dest_path, object_copy_creation, **kwargs) # noqa: E501 - - @validate_arguments - def copy_object_with_http_info(self, repository : StrictStr, branch : Annotated[StrictStr, Field(..., description="destination branch for the copy")], dest_path : Annotated[StrictStr, Field(..., description="destination path relative to the branch")], object_copy_creation : ObjectCopyCreation, **kwargs) -> ApiResponse: # noqa: E501 - """create a copy of an object # noqa: E501 + """ # noqa: E501 + + _param = self._copy_object_serialize( + repository=repository, + branch=branch, + dest_path=dest_path, + object_copy_creation=object_copy_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def copy_object_with_http_info( + self, + repository: StrictStr, + branch: Annotated[StrictStr, Field(description="destination branch for the copy")], + dest_path: Annotated[StrictStr, Field(description="destination path relative to the branch")], + object_copy_creation: ObjectCopyCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStats]: + """create a copy of an object - >>> thread = api.copy_object_with_http_info(repository, branch, dest_path, object_copy_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -109,136 +165,249 @@ def copy_object_with_http_info(self, repository : StrictStr, branch : Annotated[ :type dest_path: str :param object_copy_creation: (required) :type object_copy_creation: ObjectCopyCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'dest_path', - 'object_copy_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._copy_object_serialize( + repository=repository, + branch=branch, + dest_path=dest_path, + object_copy_creation=object_copy_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def copy_object_without_preload_content( + self, + repository: StrictStr, + branch: Annotated[StrictStr, Field(description="destination branch for the copy")], + dest_path: Annotated[StrictStr, Field(description="destination path relative to the branch")], + object_copy_creation: ObjectCopyCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create a copy of an object + + + :param repository: (required) + :type repository: str + :param branch: destination branch for the copy (required) + :type branch: str + :param dest_path: destination path relative to the branch (required) + :type dest_path: str + :param object_copy_creation: (required) + :type object_copy_creation: ObjectCopyCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_object_serialize( + repository=repository, + branch=branch, + dest_path=dest_path, + object_copy_creation=object_copy_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method copy_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _copy_object_serialize( + self, + repository, + branch, + dest_path, + object_copy_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('dest_path') is not None: # noqa: E501 - _query_params.append(('dest_path', _params['dest_path'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if dest_path is not None: + + _query_params.append(('dest_path', dest_path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['object_copy_creation'] is not None: - _body_params = _params['object_copy_creation'] + if object_copy_creation is not None: + _body_params = object_copy_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "ObjectStats", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/objects/copy', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/objects/copy', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_object(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 - """delete object. Missing objects will not return a NotFound error. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_object(repository, branch, path, force, async_req=True) - >>> result = thread.get() + @validate_call + def delete_object( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete object. Missing objects will not return a NotFound error. + :param repository: (required) :type repository: str @@ -248,31 +417,79 @@ def delete_object(self, repository : StrictStr, branch : StrictStr, path : Annot :type path: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_object_with_http_info(repository, branch, path, force, **kwargs) # noqa: E501 - - @validate_arguments - def delete_object_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """delete object. Missing objects will not return a NotFound error. # noqa: E501 + """ # noqa: E501 + + _param = self._delete_object_serialize( + repository=repository, + branch=branch, + path=path, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_object_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete object. Missing objects will not return a NotFound error. - >>> thread = api.delete_object_with_http_info(repository, branch, path, force, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -282,122 +499,236 @@ def delete_object_with_http_info(self, repository : StrictStr, branch : StrictSt :type path: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'path', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_object_serialize( + repository=repository, + branch=branch, + path=path, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def delete_object_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete object. Missing objects will not return a NotFound error. - if _params['branch']: - _path_params['branch'] = _params['branch'] + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param force: + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_object_serialize( + repository=repository, + branch=branch, + path=path, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_object_serialize( + self, + repository, + branch, + path, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/objects', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/branches/{branch}/objects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_objects(self, repository : StrictStr, branch : StrictStr, path_list : PathList, force : Optional[StrictBool] = None, **kwargs) -> ObjectErrorList: # noqa: E501 - """delete objects. Missing objects will not return a NotFound error. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_objects(repository, branch, path_list, force, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_objects( + self, + repository: StrictStr, + branch: StrictStr, + path_list: PathList, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectErrorList: + """delete objects. Missing objects will not return a NotFound error. + :param repository: (required) :type repository: str @@ -407,31 +738,79 @@ def delete_objects(self, repository : StrictStr, branch : StrictStr, path_list : :type path_list: PathList :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectErrorList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_objects_with_http_info(repository, branch, path_list, force, **kwargs) # noqa: E501 - - @validate_arguments - def delete_objects_with_http_info(self, repository : StrictStr, branch : StrictStr, path_list : PathList, force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """delete objects. Missing objects will not return a NotFound error. # noqa: E501 + """ # noqa: E501 + + _param = self._delete_objects_serialize( + repository=repository, + branch=branch, + path_list=path_list, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectErrorList", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_objects_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path_list: PathList, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectErrorList]: + """delete objects. Missing objects will not return a NotFound error. - >>> thread = api.delete_objects_with_http_info(repository, branch, path_list, force, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -441,135 +820,249 @@ def delete_objects_with_http_info(self, repository : StrictStr, branch : StrictS :type path_list: PathList :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectErrorList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'path_list', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._delete_objects_serialize( + repository=repository, + branch=branch, + path_list=path_list, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectErrorList", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_objects_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path_list: PathList, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete objects. Missing objects will not return a NotFound error. + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path_list: (required) + :type path_list: PathList + :param force: + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_objects_serialize( + repository=repository, + branch=branch, + path_list=path_list, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_objects" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectErrorList", + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _delete_objects_serialize( + self, + repository, + branch, + path_list, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['path_list'] is not None: - _body_params = _params['path_list'] + if path_list is not None: + _body_params = path_list + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "ObjectErrorList", - '401': "Error", - '403': "Error", - '404': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/objects/delete', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/objects/delete', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, if_none_match : Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, presign : Optional[StrictBool] = None, **kwargs) -> bytearray: # noqa: E501 - """get object content # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_object(repository, ref, path, range, if_none_match, presign, async_req=True) - >>> result = thread.get() + + @validate_call + def get_object( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the ref")], + range: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Byte range to retrieve")] = None, + if_none_match: Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """get object content + :param repository: (required) :type repository: str @@ -583,31 +1076,87 @@ def get_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(.. :type if_none_match: str :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: bytearray - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_object_with_http_info(repository, ref, path, range, if_none_match, presign, **kwargs) # noqa: E501 - - @validate_arguments - def get_object_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, if_none_match : Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, presign : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """get object content # noqa: E501 + """ # noqa: E501 + + _param = self._get_object_serialize( + repository=repository, + ref=ref, + path=path, + range=range, + if_none_match=if_none_match, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '206': "bytearray", + '302': None, + '304': None, + '401': "Error", + '404': "Error", + '410': "Error", + '416': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_object_with_http_info( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the ref")], + range: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Byte range to retrieve")] = None, + if_none_match: Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """get object content - >>> thread = api.get_object_with_http_info(repository, ref, path, range, if_none_match, presign, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -621,103 +1170,136 @@ def get_object_with_http_info(self, repository : StrictStr, ref : Annotated[Stri :type if_none_match: str :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'ref', - 'path', - 'range', - 'if_none_match', - 'presign' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_object_serialize( + repository=repository, + ref=ref, + path=path, + range=range, + if_none_match=if_none_match, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '206': "bytearray", + '302': None, + '304': None, + '401': "Error", + '404': "Error", + '410': "Error", + '416': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - if _params['ref']: - _path_params['ref'] = _params['ref'] + @validate_call + def get_object_without_preload_content( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the ref")], + range: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Byte range to retrieve")] = None, + if_none_match: Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get object content - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) - - if _params.get('presign') is not None: # noqa: E501 - _query_params.append(('presign', _params['presign'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - if _params['range']: - _header_params['Range'] = _params['range'] - - if _params['if_none_match']: - _header_params['If-None-Match'] = _params['if_none_match'] - - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/octet-stream', 'application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + :param repository: (required) + :type repository: str + :param ref: a reference (could be either a branch or a commit ID) (required) + :type ref: str + :param path: relative to the ref (required) + :type path: str + :param range: Byte range to retrieve + :type range: str + :param if_none_match: Returns response only if the object does not have a matching ETag + :type if_none_match: str + :param presign: + :type presign: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_object_serialize( + repository=repository, + ref=ref, + path=path, + range=range, + if_none_match=if_none_match, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "bytearray", '206': "bytearray", '302': None, @@ -728,33 +1310,120 @@ def get_object_with_http_info(self, repository : StrictStr, ref : Annotated[Stri '416': "Error", '420': None, } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_object_serialize( + self, + repository, + ref, + path, + range, + if_none_match, + presign, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if ref is not None: + _path_params['ref'] = ref + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + + if presign is not None: + + _query_params.append(('presign', presign)) + + # process the header parameters + if range is not None: + _header_params['Range'] = range + if if_none_match is not None: + _header_params['If-None-Match'] = if_none_match + # process the form parameters + # process the body parameter + - return self.api_client.call_api( - '/repositories/{repository}/refs/{ref}/objects', 'GET', - _path_params, - _query_params, - _header_params, + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/octet-stream', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{ref}/objects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def get_underlying_properties(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], **kwargs) -> UnderlyingObjectProperties: # noqa: E501 - """get object properties on underlying storage # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_underlying_properties( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the branch")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UnderlyingObjectProperties: + """get object properties on underlying storage - >>> thread = api.get_underlying_properties(repository, ref, path, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -762,31 +1431,76 @@ def get_underlying_properties(self, repository : StrictStr, ref : Annotated[Stri :type ref: str :param path: relative to the branch (required) :type path: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UnderlyingObjectProperties - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_underlying_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_underlying_properties_with_http_info(repository, ref, path, **kwargs) # noqa: E501 - - @validate_arguments - def get_underlying_properties_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], **kwargs) -> ApiResponse: # noqa: E501 - """get object properties on underlying storage # noqa: E501 + """ # noqa: E501 + + _param = self._get_underlying_properties_serialize( + repository=repository, + ref=ref, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnderlyingObjectProperties", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_underlying_properties_with_http_info( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the branch")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UnderlyingObjectProperties]: + """get object properties on underlying storage - >>> thread = api.get_underlying_properties_with_http_info(repository, ref, path, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -794,123 +1508,224 @@ def get_underlying_properties_with_http_info(self, repository : StrictStr, ref : :type ref: str :param path: relative to the branch (required) :type path: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UnderlyingObjectProperties, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_underlying_properties_serialize( + repository=repository, + ref=ref, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnderlyingObjectProperties", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'ref', - 'path' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_underlying_properties_without_preload_content( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the branch")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get object properties on underlying storage + + + :param repository: (required) + :type repository: str + :param ref: a reference (could be either a branch or a commit ID) (required) + :type ref: str + :param path: relative to the branch (required) + :type path: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_underlying_properties_serialize( + repository=repository, + ref=ref, + path=path, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_underlying_properties" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UnderlyingObjectProperties", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_underlying_properties_serialize( + self, + repository, + ref, + path, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['ref']: - _path_params['ref'] = _params['ref'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if ref is not None: + _path_params['ref'] = ref + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "UnderlyingObjectProperties", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{ref}/objects/underlyingProperties', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{ref}/objects/underlyingProperties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def head_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, **kwargs) -> None: # noqa: E501 - """check if object exists # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.head_object(repository, ref, path, range, async_req=True) - >>> result = thread.get() + @validate_call + def head_object( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the ref")], + range: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Byte range to retrieve")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """check if object exists + :param repository: (required) :type repository: str @@ -920,31 +1735,81 @@ def head_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(. :type path: str :param range: Byte range to retrieve :type range: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the head_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.head_object_with_http_info(repository, ref, path, range, **kwargs) # noqa: E501 - - @validate_arguments - def head_object_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """check if object exists # noqa: E501 + """ # noqa: E501 + + _param = self._head_object_serialize( + repository=repository, + ref=ref, + path=path, + range=range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '206': None, + '401': None, + '404': None, + '410': None, + '416': None, + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def head_object_with_http_info( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the ref")], + range: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Byte range to retrieve")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """check if object exists - >>> thread = api.head_object_with_http_info(repository, ref, path, range, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -954,118 +1819,235 @@ def head_object_with_http_info(self, repository : StrictStr, ref : Annotated[Str :type path: str :param range: Byte range to retrieve :type range: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'repository', - 'ref', - 'path', - 'range' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._head_object_serialize( + repository=repository, + ref=ref, + path=path, + range=range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '206': None, + '401': None, + '404': None, + '410': None, + '416': None, + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def head_object_without_preload_content( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the ref")], + range: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="Byte range to retrieve")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """check if object exists + + + :param repository: (required) + :type repository: str + :param ref: a reference (could be either a branch or a commit ID) (required) + :type ref: str + :param path: relative to the ref (required) + :type path: str + :param range: Byte range to retrieve + :type range: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._head_object_serialize( + repository=repository, + ref=ref, + path=path, + range=range, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method head_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '206': None, + '401': None, + '404': None, + '410': None, + '416': None, + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _head_object_serialize( + self, + repository, + ref, + path, + range, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['ref']: - _path_params['ref'] = _params['ref'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if ref is not None: + _path_params['ref'] = ref + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) - if _params['range']: - _header_params['Range'] = _params['range'] - + if range is not None: + _header_params['Range'] = range # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/repositories/{repository}/refs/{ref}/objects', 'HEAD', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='HEAD', + resource_path='/repositories/{repository}/refs/{ref}/objects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_objects(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, **kwargs) -> ObjectStatsList: # noqa: E501 - """list objects under a given prefix # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_objects(repository, ref, user_metadata, presign, after, amount, delimiter, prefix, async_req=True) - >>> result = thread.get() + + @validate_call + def list_objects( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + user_metadata: Optional[StrictBool] = None, + presign: Optional[StrictBool] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStatsList: + """list objects under a given prefix + :param repository: (required) :type repository: str @@ -1083,31 +2065,86 @@ def list_objects(self, repository : StrictStr, ref : Annotated[StrictStr, Field( :type delimiter: str :param prefix: return items prefixed with this value :type prefix: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStatsList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_objects_with_http_info(repository, ref, user_metadata, presign, after, amount, delimiter, prefix, **kwargs) # noqa: E501 - - @validate_arguments - def list_objects_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list objects under a given prefix # noqa: E501 + """ # noqa: E501 + + _param = self._list_objects_serialize( + repository=repository, + ref=ref, + user_metadata=user_metadata, + presign=presign, + after=after, + amount=amount, + delimiter=delimiter, + prefix=prefix, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStatsList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_objects_with_http_info( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + user_metadata: Optional[StrictBool] = None, + presign: Optional[StrictBool] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStatsList]: + """list objects under a given prefix - >>> thread = api.list_objects_with_http_info(repository, ref, user_metadata, presign, after, amount, delimiter, prefix, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1125,143 +2162,275 @@ def list_objects_with_http_info(self, repository : StrictStr, ref : Annotated[St :type delimiter: str :param prefix: return items prefixed with this value :type prefix: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStatsList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'ref', - 'user_metadata', - 'presign', - 'after', - 'amount', - 'delimiter', - 'prefix' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_objects_serialize( + repository=repository, + ref=ref, + user_metadata=user_metadata, + presign=presign, + after=after, + amount=amount, + delimiter=delimiter, + prefix=prefix, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_objects" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - if _params['ref']: - _path_params['ref'] = _params['ref'] - + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStatsList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('user_metadata') is not None: # noqa: E501 - _query_params.append(('user_metadata', _params['user_metadata'])) - if _params.get('presign') is not None: # noqa: E501 - _query_params.append(('presign', _params['presign'])) + @validate_call + def list_objects_without_preload_content( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + user_metadata: Optional[StrictBool] = None, + presign: Optional[StrictBool] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list objects under a given prefix - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + :param repository: (required) + :type repository: str + :param ref: a reference (could be either a branch or a commit ID) (required) + :type ref: str + :param user_metadata: + :type user_metadata: bool + :param presign: + :type presign: bool + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param delimiter: delimiter used to group common prefixes by + :type delimiter: str + :param prefix: return items prefixed with this value + :type prefix: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_objects_serialize( + repository=repository, + ref=ref, + user_metadata=user_metadata, + presign=presign, + after=after, + amount=amount, + delimiter=delimiter, + prefix=prefix, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('delimiter') is not None: # noqa: E501 - _query_params.append(('delimiter', _params['delimiter'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStatsList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_objects_serialize( + self, + repository, + ref, + user_metadata, + presign, + after, + amount, + delimiter, + prefix, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if ref is not None: + _path_params['ref'] = ref + # process the query parameters + if user_metadata is not None: + + _query_params.append(('user_metadata', user_metadata)) + + if presign is not None: + + _query_params.append(('presign', presign)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + if delimiter is not None: + + _query_params.append(('delimiter', delimiter)) + + if prefix is not None: + + _query_params.append(('prefix', prefix)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ObjectStatsList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{ref}/objects/ls', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{ref}/objects/ls', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def stat_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, **kwargs) -> ObjectStats: # noqa: E501 - """get object metadata # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.stat_object(repository, ref, path, user_metadata, presign, async_req=True) - >>> result = thread.get() + @validate_call + def stat_object( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the branch")], + user_metadata: Optional[StrictBool] = None, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStats: + """get object metadata + :param repository: (required) :type repository: str @@ -1273,31 +2442,82 @@ def stat_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(. :type user_metadata: bool :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStats - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the stat_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.stat_object_with_http_info(repository, ref, path, user_metadata, presign, **kwargs) # noqa: E501 - - @validate_arguments - def stat_object_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """get object metadata # noqa: E501 + """ # noqa: E501 + + _param = self._stat_object_serialize( + repository=repository, + ref=ref, + path=path, + user_metadata=user_metadata, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '401': "Error", + '404': "Error", + '400': "Error", + '410': None, + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def stat_object_with_http_info( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the branch")], + user_metadata: Optional[StrictBool] = None, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStats]: + """get object metadata - >>> thread = api.stat_object_with_http_info(repository, ref, path, user_metadata, presign, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1309,133 +2529,251 @@ def stat_object_with_http_info(self, repository : StrictStr, ref : Annotated[Str :type user_metadata: bool :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'ref', - 'path', - 'user_metadata', - 'presign' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._stat_object_serialize( + repository=repository, + ref=ref, + path=path, + user_metadata=user_metadata, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method stat_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '401': "Error", + '404': "Error", + '400': "Error", + '410': None, + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def stat_object_without_preload_content( + self, + repository: StrictStr, + ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + path: Annotated[StrictStr, Field(description="relative to the branch")], + user_metadata: Optional[StrictBool] = None, + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get object metadata + + + :param repository: (required) + :type repository: str + :param ref: a reference (could be either a branch or a commit ID) (required) + :type ref: str + :param path: relative to the branch (required) + :type path: str + :param user_metadata: + :type user_metadata: bool + :param presign: + :type presign: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stat_object_serialize( + repository=repository, + ref=ref, + path=path, + user_metadata=user_metadata, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['ref']: - _path_params['ref'] = _params['ref'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '401': "Error", + '404': "Error", + '400': "Error", + '410': None, + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + def _stat_object_serialize( + self, + repository, + ref, + path, + user_metadata, + presign, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('user_metadata') is not None: # noqa: E501 - _query_params.append(('user_metadata', _params['user_metadata'])) + _host = None - if _params.get('presign') is not None: # noqa: E501 - _query_params.append(('presign', _params['presign'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if ref is not None: + _path_params['ref'] = ref + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + + if user_metadata is not None: + + _query_params.append(('user_metadata', user_metadata)) + + if presign is not None: + + _query_params.append(('presign', presign)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "ObjectStats", - '401': "Error", - '404': "Error", - '400': "Error", - '410': None, - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{ref}/objects/stat', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{ref}/objects/stat', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def upload_object(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], if_none_match : Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, storage_class : Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, force : Optional[StrictBool] = None, content : Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, **kwargs) -> ObjectStats: # noqa: E501 - """upload_object # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_object(repository, branch, path, if_none_match, storage_class, force, content, async_req=True) - >>> result = thread.get() + + @validate_call + def upload_object( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + if_none_match: Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, + storage_class: Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, + force: Optional[StrictBool] = None, + content: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStats: + """upload_object + :param repository: (required) :type repository: str @@ -1451,31 +2789,87 @@ def upload_object(self, repository : StrictStr, branch : StrictStr, path : Annot :type force: bool :param content: Only a single file per upload which must be named \\\"content\\\". :type content: bytearray - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStats - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the upload_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.upload_object_with_http_info(repository, branch, path, if_none_match, storage_class, force, content, **kwargs) # noqa: E501 - - @validate_arguments - def upload_object_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], if_none_match : Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, storage_class : Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, force : Optional[StrictBool] = None, content : Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """upload_object # noqa: E501 + """ # noqa: E501 + + _param = self._upload_object_serialize( + repository=repository, + branch=branch, + path=path, + if_none_match=if_none_match, + storage_class=storage_class, + force=force, + content=content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def upload_object_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + if_none_match: Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, + storage_class: Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, + force: Optional[StrictBool] = None, + content: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStats]: + """upload_object - >>> thread = api.upload_object_with_http_info(repository, branch, path, if_none_match, storage_class, force, content, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1491,136 +2885,253 @@ def upload_object_with_http_info(self, repository : StrictStr, branch : StrictSt :type force: bool :param content: Only a single file per upload which must be named \\\"content\\\". :type content: bytearray - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'path', - 'if_none_match', - 'storage_class', - 'force', - 'content' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._upload_object_serialize( + repository=repository, + branch=branch, + path=path, + if_none_match=if_none_match, + storage_class=storage_class, + force=force, + content=content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method upload_object" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - if _params['branch']: - _path_params['branch'] = _params['branch'] + @validate_call + def upload_object_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + if_none_match: Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, + storage_class: Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, + force: Optional[StrictBool] = None, + content: Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """upload_object - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param if_none_match: Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. + :type if_none_match: str + :param storage_class: Deprecated, this capability will not be supported in future releases. + :type storage_class: str + :param force: + :type force: bool + :param content: Only a single file per upload which must be named \\\"content\\\". + :type content: bytearray + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upload_object_serialize( + repository=repository, + branch=branch, + path=path, + if_none_match=if_none_match, + storage_class=storage_class, + force=force, + content=content, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('storage_class') is not None: # noqa: E501 - _query_params.append(('storageClass', _params['storage_class'])) + _response_types_map: Dict[str, Optional[str]] = { + '201': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upload_object_serialize( + self, + repository, + branch, + path, + if_none_match, + storage_class, + force, + content, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + + if storage_class is not None: + + _query_params.append(('storageClass', storage_class)) + + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) - if _params['if_none_match']: - _header_params['If-None-Match'] = _params['if_none_match'] - + if if_none_match is not None: + _header_params['If-None-Match'] = if_none_match # process the form parameters - _form_params = [] - _files = {} - if _params['content']: - _files['content'] = _params['content'] - + if content is not None: + _files['content'] = content # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data', 'application/octet-stream'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data', + 'application/octet-stream' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "ObjectStats", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '412': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/objects', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/branches/{branch}/objects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/refs_api.py b/clients/python/lakefs_sdk/api/refs_api.py index 58084c36a40..8fb3d6e4852 100644 --- a/clients/python/lakefs_sdk/api/refs_api.py +++ b/clients/python/lakefs_sdk/api/refs_api.py @@ -12,61 +12,71 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from datetime import datetime - try: - from pydantic.v1 import Field, StrictBool, StrictStr, conint, conlist + from pydantic.v1 import Field, StrictBool, StrictStr, field_validator except ImportError: - from pydantic import Field, StrictBool, StrictStr, conint, conlist - -from typing import Optional - + from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated from lakefs_sdk.models.commit_list import CommitList from lakefs_sdk.models.diff_list import DiffList from lakefs_sdk.models.find_merge_base_result import FindMergeBaseResult from lakefs_sdk.models.merge import Merge from lakefs_sdk.models.merge_result import MergeResult -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class RefsApi(object): +class RefsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def diff_refs(self, repository : StrictStr, left_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], right_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID) to compare against")], after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, type : Optional[StrictStr] = None, **kwargs) -> DiffList: # noqa: E501 - """diff references # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def diff_refs( + self, + repository: StrictStr, + left_ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + right_ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID) to compare against")], + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiffList: + """diff references - >>> thread = api.diff_refs(repository, left_ref, right_ref, after, amount, prefix, delimiter, type, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -84,31 +94,86 @@ def diff_refs(self, repository : StrictStr, left_ref : Annotated[StrictStr, Fiel :type delimiter: str :param type: :type type: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: DiffList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the diff_refs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.diff_refs_with_http_info(repository, left_ref, right_ref, after, amount, prefix, delimiter, type, **kwargs) # noqa: E501 - - @validate_arguments - def diff_refs_with_http_info(self, repository : StrictStr, left_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], right_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID) to compare against")], after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 - """diff references # noqa: E501 + """ # noqa: E501 + + _param = self._diff_refs_serialize( + repository=repository, + left_ref=left_ref, + right_ref=right_ref, + after=after, + amount=amount, + prefix=prefix, + delimiter=delimiter, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiffList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def diff_refs_with_http_info( + self, + repository: StrictStr, + left_ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + right_ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID) to compare against")], + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiffList]: + """diff references - >>> thread = api.diff_refs_with_http_info(repository, left_ref, right_ref, after, amount, prefix, delimiter, type, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -126,143 +191,271 @@ def diff_refs_with_http_info(self, repository : StrictStr, left_ref : Annotated[ :type delimiter: str :param type: :type type: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(DiffList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'left_ref', - 'right_ref', - 'after', - 'amount', - 'prefix', - 'delimiter', - 'type' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._diff_refs_serialize( + repository=repository, + left_ref=left_ref, + right_ref=right_ref, + after=after, + amount=amount, + prefix=prefix, + delimiter=delimiter, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method diff_refs" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - if _params['left_ref']: - _path_params['leftRef'] = _params['left_ref'] - - if _params['right_ref']: - _path_params['rightRef'] = _params['right_ref'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiffList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + @validate_call + def diff_refs_without_preload_content( + self, + repository: StrictStr, + left_ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID)")], + right_ref: Annotated[StrictStr, Field(description="a reference (could be either a branch or a commit ID) to compare against")], + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + delimiter: Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """diff references - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + :param repository: (required) + :type repository: str + :param left_ref: a reference (could be either a branch or a commit ID) (required) + :type left_ref: str + :param right_ref: a reference (could be either a branch or a commit ID) to compare against (required) + :type right_ref: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param prefix: return items prefixed with this value + :type prefix: str + :param delimiter: delimiter used to group common prefixes by + :type delimiter: str + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._diff_refs_serialize( + repository=repository, + left_ref=left_ref, + right_ref=right_ref, + after=after, + amount=amount, + prefix=prefix, + delimiter=delimiter, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('delimiter') is not None: # noqa: E501 - _query_params.append(('delimiter', _params['delimiter'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiffList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _diff_refs_serialize( + self, + repository, + left_ref, + right_ref, + after, + amount, + prefix, + delimiter, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('type') is not None: # noqa: E501 - _query_params.append(('type', _params['type'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if left_ref is not None: + _path_params['leftRef'] = left_ref + if right_ref is not None: + _path_params['rightRef'] = right_ref + # process the query parameters + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if delimiter is not None: + + _query_params.append(('delimiter', delimiter)) + + if type is not None: + + _query_params.append(('type', type)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "DiffList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{leftRef}/diff/{rightRef}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{leftRef}/diff/{rightRef}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def find_merge_base(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], **kwargs) -> FindMergeBaseResult: # noqa: E501 - """find the merge base for 2 references # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_merge_base(repository, source_ref, destination_branch, async_req=True) - >>> result = thread.get() + @validate_call + def find_merge_base( + self, + repository: StrictStr, + source_ref: Annotated[StrictStr, Field(description="source ref")], + destination_branch: Annotated[StrictStr, Field(description="destination branch name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindMergeBaseResult: + """find the merge base for 2 references + :param repository: (required) :type repository: str @@ -270,31 +463,77 @@ def find_merge_base(self, repository : StrictStr, source_ref : Annotated[StrictS :type source_ref: str :param destination_branch: destination branch name (required) :type destination_branch: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: FindMergeBaseResult - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the find_merge_base_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.find_merge_base_with_http_info(repository, source_ref, destination_branch, **kwargs) # noqa: E501 - - @validate_arguments - def find_merge_base_with_http_info(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], **kwargs) -> ApiResponse: # noqa: E501 - """find the merge base for 2 references # noqa: E501 + """ # noqa: E501 + + _param = self._find_merge_base_serialize( + repository=repository, + source_ref=source_ref, + destination_branch=destination_branch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindMergeBaseResult", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_merge_base_with_http_info( + self, + repository: StrictStr, + source_ref: Annotated[StrictStr, Field(description="source ref")], + destination_branch: Annotated[StrictStr, Field(description="destination branch name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindMergeBaseResult]: + """find the merge base for 2 references - >>> thread = api.find_merge_base_with_http_info(repository, source_ref, destination_branch, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -302,124 +541,230 @@ def find_merge_base_with_http_info(self, repository : StrictStr, source_ref : An :type source_ref: str :param destination_branch: destination branch name (required) :type destination_branch: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(FindMergeBaseResult, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._find_merge_base_serialize( + repository=repository, + source_ref=source_ref, + destination_branch=destination_branch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindMergeBaseResult", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'source_ref', - 'destination_branch' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def find_merge_base_without_preload_content( + self, + repository: StrictStr, + source_ref: Annotated[StrictStr, Field(description="source ref")], + destination_branch: Annotated[StrictStr, Field(description="destination branch name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """find the merge base for 2 references + + + :param repository: (required) + :type repository: str + :param source_ref: source ref (required) + :type source_ref: str + :param destination_branch: destination branch name (required) + :type destination_branch: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_merge_base_serialize( + repository=repository, + source_ref=source_ref, + destination_branch=destination_branch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method find_merge_base" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindMergeBaseResult", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _find_merge_base_serialize( + self, + repository, + source_ref, + destination_branch, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['source_ref']: - _path_params['sourceRef'] = _params['source_ref'] + _host = None - if _params['destination_branch']: - _path_params['destinationBranch'] = _params['destination_branch'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if source_ref is not None: + _path_params['sourceRef'] = source_ref + if destination_branch is not None: + _path_params['destinationBranch'] = destination_branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "FindMergeBaseResult", - '400': "Error", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def log_commits(self, repository : StrictStr, ref : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, **kwargs) -> CommitList: # noqa: E501 - """get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.log_commits(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, async_req=True) - >>> result = thread.get() + + @validate_call + def log_commits( + self, + repository: StrictStr, + ref: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + objects: Annotated[Optional[List[StrictStr]], Field(description="list of paths, each element is a path of a specific object")] = None, + prefixes: Annotated[Optional[List[StrictStr]], Field(description="list of paths, each element is a path of a prefix")] = None, + limit: Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, + first_parent: Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, + since: Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, + stop_at: Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CommitList: + """get commit log from ref. If both objects and prefixes are empty, return all commits. + :param repository: (required) :type repository: str @@ -441,31 +786,90 @@ def log_commits(self, repository : StrictStr, ref : StrictStr, after : Annotated :type since: datetime :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. :type stop_at: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CommitList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the log_commits_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.log_commits_with_http_info(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, **kwargs) # noqa: E501 - - @validate_arguments - def log_commits_with_http_info(self, repository : StrictStr, ref : StrictStr, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 + """ # noqa: E501 + + _param = self._log_commits_serialize( + repository=repository, + ref=ref, + after=after, + amount=amount, + objects=objects, + prefixes=prefixes, + limit=limit, + first_parent=first_parent, + since=since, + stop_at=stop_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "CommitList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def log_commits_with_http_info( + self, + repository: StrictStr, + ref: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + objects: Annotated[Optional[List[StrictStr]], Field(description="list of paths, each element is a path of a specific object")] = None, + prefixes: Annotated[Optional[List[StrictStr]], Field(description="list of paths, each element is a path of a prefix")] = None, + limit: Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, + first_parent: Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, + since: Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, + stop_at: Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CommitList]: + """get commit log from ref. If both objects and prefixes are empty, return all commits. - >>> thread = api.log_commits_with_http_info(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -487,156 +891,305 @@ def log_commits_with_http_info(self, repository : StrictStr, ref : StrictStr, af :type since: datetime :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. :type stop_at: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CommitList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'ref', - 'after', - 'amount', - 'objects', - 'prefixes', - 'limit', - 'first_parent', - 'since', - 'stop_at' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._log_commits_serialize( + repository=repository, + ref=ref, + after=after, + amount=amount, + objects=objects, + prefixes=prefixes, + limit=limit, + first_parent=first_parent, + since=since, + stop_at=stop_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method log_commits" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - if _params['ref']: - _path_params['ref'] = _params['ref'] - + _response_types_map: Dict[str, Optional[str]] = { + '200': "CommitList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + @validate_call + def log_commits_without_preload_content( + self, + repository: StrictStr, + ref: StrictStr, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + objects: Annotated[Optional[List[StrictStr]], Field(description="list of paths, each element is a path of a specific object")] = None, + prefixes: Annotated[Optional[List[StrictStr]], Field(description="list of paths, each element is a path of a prefix")] = None, + limit: Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, + first_parent: Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, + since: Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, + stop_at: Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get commit log from ref. If both objects and prefixes are empty, return all commits. - if _params.get('objects') is not None: # noqa: E501 - _query_params.append(('objects', _params['objects'])) - _collection_formats['objects'] = 'multi' - if _params.get('prefixes') is not None: # noqa: E501 - _query_params.append(('prefixes', _params['prefixes'])) - _collection_formats['prefixes'] = 'multi' + :param repository: (required) + :type repository: str + :param ref: (required) + :type ref: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param objects: list of paths, each element is a path of a specific object + :type objects: List[str] + :param prefixes: list of paths, each element is a path of a prefix + :type prefixes: List[str] + :param limit: limit the number of items in return to 'amount'. Without further indication on actual number of items. + :type limit: bool + :param first_parent: if set to true, follow only the first parent upon reaching a merge commit + :type first_parent: bool + :param since: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. + :type since: datetime + :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. + :type stop_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_commits_serialize( + repository=repository, + ref=ref, + after=after, + amount=amount, + objects=objects, + prefixes=prefixes, + limit=limit, + first_parent=first_parent, + since=since, + stop_at=stop_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "CommitList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _log_commits_serialize( + self, + repository, + ref, + after, + amount, + objects, + prefixes, + limit, + first_parent, + since, + stop_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'objects': 'multi', + 'prefixes': 'multi', + } - if _params.get('first_parent') is not None: # noqa: E501 - _query_params.append(('first_parent', _params['first_parent'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None - if _params.get('since') is not None: # noqa: E501 - if isinstance(_params['since'], datetime): - _query_params.append(('since', _params['since'].strftime(self.api_client.configuration.datetime_format))) + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if ref is not None: + _path_params['ref'] = ref + # process the query parameters + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + + if objects is not None: + + _query_params.append(('objects', objects)) + + if prefixes is not None: + + _query_params.append(('prefixes', prefixes)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if first_parent is not None: + + _query_params.append(('first_parent', first_parent)) + + if since is not None: + if isinstance(since, datetime): + _query_params.append( + ( + 'since', + since.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) else: - _query_params.append(('since', _params['since'])) - - if _params.get('stop_at') is not None: # noqa: E501 - _query_params.append(('stop_at', _params['stop_at'])) - + _query_params.append(('since', since)) + + if stop_at is not None: + + _query_params.append(('stop_at', stop_at)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "CommitList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{ref}/commits', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/refs/{ref}/commits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def merge_into_branch(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], merge : Optional[Merge] = None, **kwargs) -> MergeResult: # noqa: E501 - """merge references # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.merge_into_branch(repository, source_ref, destination_branch, merge, async_req=True) - >>> result = thread.get() + + @validate_call + def merge_into_branch( + self, + repository: StrictStr, + source_ref: Annotated[StrictStr, Field(description="source ref")], + destination_branch: Annotated[StrictStr, Field(description="destination branch name")], + merge: Optional[Merge] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MergeResult: + """merge references + :param repository: (required) :type repository: str @@ -646,31 +1199,82 @@ def merge_into_branch(self, repository : StrictStr, source_ref : Annotated[Stric :type destination_branch: str :param merge: :type merge: Merge - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: MergeResult - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the merge_into_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.merge_into_branch_with_http_info(repository, source_ref, destination_branch, merge, **kwargs) # noqa: E501 - - @validate_arguments - def merge_into_branch_with_http_info(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], merge : Optional[Merge] = None, **kwargs) -> ApiResponse: # noqa: E501 - """merge references # noqa: E501 + """ # noqa: E501 + + _param = self._merge_into_branch_serialize( + repository=repository, + source_ref=source_ref, + destination_branch=destination_branch, + merge=merge, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "MergeResult", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "MergeResult", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def merge_into_branch_with_http_info( + self, + repository: StrictStr, + source_ref: Annotated[StrictStr, Field(description="source ref")], + destination_branch: Annotated[StrictStr, Field(description="destination branch name")], + merge: Optional[Merge] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MergeResult]: + """merge references - >>> thread = api.merge_into_branch_with_http_info(repository, source_ref, destination_branch, merge, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -680,125 +1284,224 @@ def merge_into_branch_with_http_info(self, repository : StrictStr, source_ref : :type destination_branch: str :param merge: :type merge: Merge - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(MergeResult, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'source_ref', - 'destination_branch', - 'merge' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._merge_into_branch_serialize( + repository=repository, + source_ref=source_ref, + destination_branch=destination_branch, + merge=merge, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MergeResult", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "MergeResult", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def merge_into_branch_without_preload_content( + self, + repository: StrictStr, + source_ref: Annotated[StrictStr, Field(description="source ref")], + destination_branch: Annotated[StrictStr, Field(description="destination branch name")], + merge: Optional[Merge] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """merge references + + + :param repository: (required) + :type repository: str + :param source_ref: source ref (required) + :type source_ref: str + :param destination_branch: destination branch name (required) + :type destination_branch: str + :param merge: + :type merge: Merge + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._merge_into_branch_serialize( + repository=repository, + source_ref=source_ref, + destination_branch=destination_branch, + merge=merge, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method merge_into_branch" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MergeResult", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "MergeResult", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _merge_into_branch_serialize( + self, + repository, + source_ref, + destination_branch, + merge, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['source_ref']: - _path_params['sourceRef'] = _params['source_ref'] + _host = None - if _params['destination_branch']: - _path_params['destinationBranch'] = _params['destination_branch'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if source_ref is not None: + _path_params['sourceRef'] = source_ref + if destination_branch is not None: + _path_params['destinationBranch'] = destination_branch # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['merge'] is not None: - _body_params = _params['merge'] + if merge is not None: + _body_params = merge + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "MergeResult", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '409': "MergeResult", - '412': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/repositories_api.py b/clients/python/lakefs_sdk/api/repositories_api.py index f31d2c1d818..5b0845e77d6 100644 --- a/clients/python/lakefs_sdk/api/repositories_api.py +++ b/clients/python/lakefs_sdk/api/repositories_api.py @@ -12,24 +12,20 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictStr, conint, conlist + from pydantic.v1 import Field, StrictBool, StrictStr except ImportError: - from pydantic import Field, StrictBool, StrictStr, conint, conlist - + from pydantic import Field, StrictBool, StrictStr from typing import Dict, List, Optional - +from typing_extensions import Annotated from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules from lakefs_sdk.models.refs_restore import RefsRestore @@ -40,1318 +36,2539 @@ from lakefs_sdk.models.repository_restore_status import RepositoryRestoreStatus from lakefs_sdk.models.task_info import TaskInfo -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class RepositoriesApi(object): +class RepositoriesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_repository(self, repository_creation : RepositoryCreation, bare : Annotated[Optional[StrictBool], Field(description="If true, create a bare repository with no initial commit and branch")] = None, **kwargs) -> Repository: # noqa: E501 - """create repository # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_repository( + self, + repository_creation: RepositoryCreation, + bare: Annotated[Optional[StrictBool], Field(description="If true, create a bare repository with no initial commit and branch")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Repository: + """create repository - >>> thread = api.create_repository(repository_creation, bare, async_req=True) - >>> result = thread.get() :param repository_creation: (required) :type repository_creation: RepositoryCreation :param bare: If true, create a bare repository with no initial commit and branch :type bare: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Repository - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_repository_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_repository_with_http_info(repository_creation, bare, **kwargs) # noqa: E501 - - @validate_arguments - def create_repository_with_http_info(self, repository_creation : RepositoryCreation, bare : Annotated[Optional[StrictBool], Field(description="If true, create a bare repository with no initial commit and branch")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """create repository # noqa: E501 + """ # noqa: E501 + + _param = self._create_repository_serialize( + repository_creation=repository_creation, + bare=bare, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "Repository", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_repository_with_http_info( + self, + repository_creation: RepositoryCreation, + bare: Annotated[Optional[StrictBool], Field(description="If true, create a bare repository with no initial commit and branch")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Repository]: + """create repository - >>> thread = api.create_repository_with_http_info(repository_creation, bare, async_req=True) - >>> result = thread.get() :param repository_creation: (required) :type repository_creation: RepositoryCreation :param bare: If true, create a bare repository with no initial commit and branch :type bare: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Repository, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_repository_serialize( + repository_creation=repository_creation, + bare=bare, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Repository", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository_creation', - 'bare' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_repository_without_preload_content( + self, + repository_creation: RepositoryCreation, + bare: Annotated[Optional[StrictBool], Field(description="If true, create a bare repository with no initial commit and branch")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create repository + + + :param repository_creation: (required) + :type repository_creation: RepositoryCreation + :param bare: If true, create a bare repository with no initial commit and branch + :type bare: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_repository_serialize( + repository_creation=repository_creation, + bare=bare, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_repository" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Repository", + '400': "Error", + '401': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _create_repository_serialize( + self, + repository_creation, + bare, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('bare') is not None: # noqa: E501 - _query_params.append(('bare', _params['bare'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if bare is not None: + + _query_params.append(('bare', bare)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['repository_creation'] is not None: - _body_params = _params['repository_creation'] + if repository_creation is not None: + _body_params = repository_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "Repository", - '400': "Error", - '401': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_gc_rules(self, repository : StrictStr, **kwargs) -> None: # noqa: E501 - """delete_gc_rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_gc_rules(repository, async_req=True) - >>> result = thread.get() + @validate_call + def delete_gc_rules( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_gc_rules + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_gc_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_gc_rules_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def delete_gc_rules_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """delete_gc_rules # noqa: E501 + """ # noqa: E501 + + _param = self._delete_gc_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_gc_rules_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_gc_rules - >>> thread = api.delete_gc_rules_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_gc_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_gc_rules_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_gc_rules + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_gc_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_gc_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _delete_gc_rules_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/settings/gc_rules', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/settings/gc_rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_repository(self, repository : StrictStr, force : Annotated[Optional[StrictBool], Field(description="Bypass read-only protection and delete the repository")] = None, **kwargs) -> None: # noqa: E501 - """delete repository # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_repository(repository, force, async_req=True) - >>> result = thread.get() + @validate_call + def delete_repository( + self, + repository: StrictStr, + force: Annotated[Optional[StrictBool], Field(description="Bypass read-only protection and delete the repository")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete repository + :param repository: (required) :type repository: str :param force: Bypass read-only protection and delete the repository :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_repository_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_repository_with_http_info(repository, force, **kwargs) # noqa: E501 - - @validate_arguments - def delete_repository_with_http_info(self, repository : StrictStr, force : Annotated[Optional[StrictBool], Field(description="Bypass read-only protection and delete the repository")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """delete repository # noqa: E501 + """ # noqa: E501 + + _param = self._delete_repository_serialize( + repository=repository, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_repository_with_http_info( + self, + repository: StrictStr, + force: Annotated[Optional[StrictBool], Field(description="Bypass read-only protection and delete the repository")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete repository - >>> thread = api.delete_repository_with_http_info(repository, force, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param force: Bypass read-only protection and delete the repository :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_repository_serialize( + repository=repository, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_repository_without_preload_content( + self, + repository: StrictStr, + force: Annotated[Optional[StrictBool], Field(description="Bypass read-only protection and delete the repository")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete repository + + + :param repository: (required) + :type repository: str + :param force: Bypass read-only protection and delete the repository + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_repository_serialize( + repository=repository, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_repository" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _delete_repository_serialize( + self, + repository, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def dump_status(self, repository : StrictStr, task_id : StrictStr, **kwargs) -> RepositoryDumpStatus: # noqa: E501 - """Status of a repository dump task # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.dump_status(repository, task_id, async_req=True) - >>> result = thread.get() + @validate_call + def dump_status( + self, + repository: StrictStr, + task_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RepositoryDumpStatus: + """Status of a repository dump task + :param repository: (required) :type repository: str :param task_id: (required) :type task_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: RepositoryDumpStatus - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the dump_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.dump_status_with_http_info(repository, task_id, **kwargs) # noqa: E501 - - @validate_arguments - def dump_status_with_http_info(self, repository : StrictStr, task_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Status of a repository dump task # noqa: E501 + """ # noqa: E501 + + _param = self._dump_status_serialize( + repository=repository, + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryDumpStatus", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def dump_status_with_http_info( + self, + repository: StrictStr, + task_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RepositoryDumpStatus]: + """Status of a repository dump task - >>> thread = api.dump_status_with_http_info(repository, task_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param task_id: (required) :type task_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(RepositoryDumpStatus, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'task_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._dump_status_serialize( + repository=repository, + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method dump_status" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] - - - # process the query parameters - _query_params = [] - if _params.get('task_id') is not None: # noqa: E501 - _query_params.append(('task_id', _params['task_id'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "RepositoryDumpStatus", '400': "Error", '401': "Error", '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories/{repository}/dump', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def dump_submit(self, repository : StrictStr, **kwargs) -> TaskInfo: # noqa: E501 - """Backup the repository metadata (tags, commits, branches) and save the backup to the object store. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.dump_submit(repository, async_req=True) - >>> result = thread.get() - - :param repository: (required) - :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TaskInfo - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the dump_submit_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.dump_submit_with_http_info(repository, **kwargs) # noqa: E501 + ) - @validate_arguments - def dump_submit_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Backup the repository metadata (tags, commits, branches) and save the backup to the object store. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def dump_status_without_preload_content( + self, + repository: StrictStr, + task_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Status of a repository dump task - >>> thread = api.dump_submit_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param task_id: (required) + :type task_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TaskInfo, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._dump_status_serialize( + repository=repository, + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryDumpStatus", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method dump_submit" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _dump_status_serialize( + self, + repository, + task_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] + if task_id is not None: + + _query_params.append(('task_id', task_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '202': "TaskInfo", - '400': "Error", - '401': "Error", - '404': "Error", - } + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - return self.api_client.call_api( - '/repositories/{repository}/dump', 'POST', - _path_params, - _query_params, - _header_params, + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/dump', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_branch_protection_rules(self, repository : StrictStr, **kwargs) -> List[BranchProtectionRule]: # noqa: E501 - """get branch protection rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_branch_protection_rules(repository, async_req=True) - >>> result = thread.get() + + @validate_call + def dump_submit( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskInfo: + """Backup the repository metadata (tags, commits, branches) and save the backup to the object store. + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[BranchProtectionRule] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_branch_protection_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_branch_protection_rules_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def get_branch_protection_rules_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get branch protection rules # noqa: E501 + """ # noqa: E501 + + _param = self._dump_submit_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskInfo", + '400': "Error", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def dump_submit_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskInfo]: + """Backup the repository metadata (tags, commits, branches) and save the backup to the object store. - >>> thread = api.get_branch_protection_rules_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[BranchProtectionRule], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._dump_submit_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskInfo", + '400': "Error", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def dump_submit_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Backup the repository metadata (tags, commits, branches) and save the backup to the object store. + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._dump_submit_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_branch_protection_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskInfo", + '400': "Error", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _dump_submit_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "List[BranchProtectionRule]", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/settings/branch_protection', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/dump', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_gc_rules(self, repository : StrictStr, **kwargs) -> GarbageCollectionRules: # noqa: E501 - """get repository GC rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_gc_rules(repository, async_req=True) - >>> result = thread.get() + @validate_call + def get_branch_protection_rules( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[BranchProtectionRule]: + """get branch protection rules + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: GarbageCollectionRules - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_gc_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_gc_rules_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def get_gc_rules_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get repository GC rules # noqa: E501 + """ # noqa: E501 + + _param = self._get_branch_protection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BranchProtectionRule]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_branch_protection_rules_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[BranchProtectionRule]]: + """get branch protection rules - >>> thread = api.get_gc_rules_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(GarbageCollectionRules, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_branch_protection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BranchProtectionRule]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_branch_protection_rules_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get branch protection rules + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_branch_protection_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_gc_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[BranchProtectionRule]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_branch_protection_rules_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "GarbageCollectionRules", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/settings/gc_rules', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/settings/branch_protection', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_repository(self, repository : StrictStr, **kwargs) -> Repository: # noqa: E501 - """get repository # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_repository(repository, async_req=True) - >>> result = thread.get() + + @validate_call + def get_gc_rules( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GarbageCollectionRules: + """get repository GC rules + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Repository - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_repository_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_repository_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def get_repository_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get repository # noqa: E501 + """ # noqa: E501 + + _param = self._get_gc_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionRules", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_gc_rules_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GarbageCollectionRules]: + """get repository GC rules - >>> thread = api.get_repository_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Repository, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_gc_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionRules", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_gc_rules_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get repository GC rules + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_gc_rules_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_repository" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "GarbageCollectionRules", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_gc_rules_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Repository", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/settings/gc_rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_repository_metadata(self, repository : StrictStr, **kwargs) -> Dict[str, str]: # noqa: E501 - """get repository metadata # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_repository_metadata(repository, async_req=True) - >>> result = thread.get() + + @validate_call + def get_repository( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Repository: + """get repository + :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Dict[str, str] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_repository_metadata_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_repository_metadata_with_http_info(repository, **kwargs) # noqa: E501 - - @validate_arguments - def get_repository_metadata_with_http_info(self, repository : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get repository metadata # noqa: E501 + """ # noqa: E501 + + _param = self._get_repository_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "Repository", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_repository_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Repository]: + """get repository - >>> thread = api.get_repository_metadata_with_http_info(repository, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Dict[str, str], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_repository_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Repository", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_repository_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get repository + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repository_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_repository_metadata" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Repository", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_repository_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_repository_metadata( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, str]: + """get repository metadata + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repository_metadata_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, str]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_repository_metadata_with_http_info( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, str]]: + """get repository metadata + + + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repository_metadata_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, str]", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_repository_metadata_without_preload_content( + self, + repository: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get repository metadata + - _response_types_map = { + :param repository: (required) + :type repository: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_repository_metadata_serialize( + repository=repository, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { '200': "Dict[str, str]", '401': "Error", '404': "Error", '420': None, } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_repository_metadata_serialize( + self, + repository, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - return self.api_client.call_api( - '/repositories/{repository}/metadata', 'GET', - _path_params, - _query_params, - _header_params, + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_repositories(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> RepositoryList: # noqa: E501 - """list repositories # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_repositories(prefix, after, amount, async_req=True) - >>> result = thread.get() + + @validate_call + def list_repositories( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RepositoryList: + """list repositories + :param prefix: return items prefixed with this value :type prefix: str @@ -1359,31 +2576,75 @@ def list_repositories(self, prefix : Annotated[Optional[StrictStr], Field(descri :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: RepositoryList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_repositories_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_repositories_with_http_info(prefix, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_repositories_with_http_info(self, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list repositories # noqa: E501 + """ # noqa: E501 + + _param = self._list_repositories_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_repositories_with_http_info( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RepositoryList]: + """list repositories - >>> thread = api.list_repositories_with_http_info(prefix, after, amount, async_req=True) - >>> result = thread.get() :param prefix: return items prefixed with this value :type prefix: str @@ -1391,427 +2652,814 @@ def list_repositories_with_http_info(self, prefix : Annotated[Optional[StrictStr :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(RepositoryList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_repositories_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def list_repositories_without_preload_content( + self, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list repositories + + + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_repositories_serialize( + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_repositories" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryList", + '401': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _list_repositories_serialize( + self, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + _host = None - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def restore_status( + self, + repository: StrictStr, + task_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RepositoryRestoreStatus: + """Status of a restore request + + + :param repository: (required) + :type repository: str + :param task_id: (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restore_status_serialize( + repository=repository, + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { - '200': "RepositoryList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryRestoreStatus", + '400': "Error", '401': "Error", + '404': "Error", '420': None, } - - return self.api_client.call_api( - '/repositories', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def restore_status(self, repository : StrictStr, task_id : StrictStr, **kwargs) -> RepositoryRestoreStatus: # noqa: E501 - """Status of a restore request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def restore_status_with_http_info( + self, + repository: StrictStr, + task_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RepositoryRestoreStatus]: + """Status of a restore request - >>> thread = api.restore_status(repository, task_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param task_id: (required) :type task_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: RepositoryRestoreStatus - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the restore_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.restore_status_with_http_info(repository, task_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._restore_status_serialize( + repository=repository, + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryRestoreStatus", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def restore_status_with_http_info(self, repository : StrictStr, task_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Status of a restore request # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def restore_status_without_preload_content( + self, + repository: StrictStr, + task_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Status of a restore request - >>> thread = api.restore_status_with_http_info(repository, task_id, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param task_id: (required) :type task_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(RepositoryRestoreStatus, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._restore_status_serialize( + repository=repository, + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'repository', - 'task_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "RepositoryRestoreStatus", + '400': "Error", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method restore_status" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _restore_status_serialize( + self, + repository, + task_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] - if _params.get('task_id') is not None: # noqa: E501 - _query_params.append(('task_id', _params['task_id'])) - + if task_id is not None: + + _query_params.append(('task_id', task_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "RepositoryRestoreStatus", - '400': "Error", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/restore', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/restore', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def restore_submit(self, repository : StrictStr, refs_restore : RefsRestore, **kwargs) -> TaskInfo: # noqa: E501 - """Restore repository from a dump in the object store # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.restore_submit(repository, refs_restore, async_req=True) - >>> result = thread.get() + + @validate_call + def restore_submit( + self, + repository: StrictStr, + refs_restore: RefsRestore, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskInfo: + """Restore repository from a dump in the object store + :param repository: (required) :type repository: str :param refs_restore: (required) :type refs_restore: RefsRestore - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TaskInfo - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the restore_submit_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.restore_submit_with_http_info(repository, refs_restore, **kwargs) # noqa: E501 - - @validate_arguments - def restore_submit_with_http_info(self, repository : StrictStr, refs_restore : RefsRestore, **kwargs) -> ApiResponse: # noqa: E501 - """Restore repository from a dump in the object store # noqa: E501 + """ # noqa: E501 + + _param = self._restore_submit_serialize( + repository=repository, + refs_restore=refs_restore, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskInfo", + '400': "Error", + '403': "Error", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def restore_submit_with_http_info( + self, + repository: StrictStr, + refs_restore: RefsRestore, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskInfo]: + """Restore repository from a dump in the object store - >>> thread = api.restore_submit_with_http_info(repository, refs_restore, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param refs_restore: (required) :type refs_restore: RefsRestore - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TaskInfo, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._restore_submit_serialize( + repository=repository, + refs_restore=refs_restore, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskInfo", + '400': "Error", + '403': "Error", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'refs_restore' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def restore_submit_without_preload_content( + self, + repository: StrictStr, + refs_restore: RefsRestore, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Restore repository from a dump in the object store + + + :param repository: (required) + :type repository: str + :param refs_restore: (required) + :type refs_restore: RefsRestore + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restore_submit_serialize( + repository=repository, + refs_restore=refs_restore, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method restore_submit" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskInfo", + '400': "Error", + '403': "Error", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _restore_submit_serialize( + self, + repository, + refs_restore, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['refs_restore'] is not None: - _body_params = _params['refs_restore'] + if refs_restore is not None: + _body_params = refs_restore + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '202': "TaskInfo", - '400': "Error", - '403': "Error", - '401': "Error", - '404': "Error", - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/restore', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/restore', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def set_branch_protection_rules(self, repository : StrictStr, branch_protection_rule : conlist(BranchProtectionRule), if_match : Annotated[Optional[StrictStr], Field(description="if provided, the branch protection rules will be updated only if the current ETag match the provided value")] = None, **kwargs) -> None: # noqa: E501 - """set_branch_protection_rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def set_branch_protection_rules( + self, + repository: StrictStr, + branch_protection_rule: List[BranchProtectionRule], + if_match: Annotated[Optional[StrictStr], Field(description="if provided, the branch protection rules will be updated only if the current ETag match the provided value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """set_branch_protection_rules - >>> thread = api.set_branch_protection_rules(repository, branch_protection_rule, if_match, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1819,31 +3467,79 @@ def set_branch_protection_rules(self, repository : StrictStr, branch_protection_ :type branch_protection_rule: List[BranchProtectionRule] :param if_match: if provided, the branch protection rules will be updated only if the current ETag match the provided value :type if_match: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the set_branch_protection_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.set_branch_protection_rules_with_http_info(repository, branch_protection_rule, if_match, **kwargs) # noqa: E501 - - @validate_arguments - def set_branch_protection_rules_with_http_info(self, repository : StrictStr, branch_protection_rule : conlist(BranchProtectionRule), if_match : Annotated[Optional[StrictStr], Field(description="if provided, the branch protection rules will be updated only if the current ETag match the provided value")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """set_branch_protection_rules # noqa: E501 + """ # noqa: E501 + + _param = self._set_branch_protection_rules_serialize( + repository=repository, + branch_protection_rule=branch_protection_rule, + if_match=if_match, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def set_branch_protection_rules_with_http_info( + self, + repository: StrictStr, + branch_protection_rule: List[BranchProtectionRule], + if_match: Annotated[Optional[StrictStr], Field(description="if provided, the branch protection rules will be updated only if the current ETag match the provided value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """set_branch_protection_rules - >>> thread = api.set_branch_protection_rules_with_http_info(repository, branch_protection_rule, if_match, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -1851,262 +3547,515 @@ def set_branch_protection_rules_with_http_info(self, repository : StrictStr, bra :type branch_protection_rule: List[BranchProtectionRule] :param if_match: if provided, the branch protection rules will be updated only if the current ETag match the provided value :type if_match: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._set_branch_protection_rules_serialize( + repository=repository, + branch_protection_rule=branch_protection_rule, + if_match=if_match, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'branch_protection_rule', - 'if_match' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def set_branch_protection_rules_without_preload_content( + self, + repository: StrictStr, + branch_protection_rule: List[BranchProtectionRule], + if_match: Annotated[Optional[StrictStr], Field(description="if provided, the branch protection rules will be updated only if the current ETag match the provided value")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """set_branch_protection_rules + + + :param repository: (required) + :type repository: str + :param branch_protection_rule: (required) + :type branch_protection_rule: List[BranchProtectionRule] + :param if_match: if provided, the branch protection rules will be updated only if the current ETag match the provided value + :type if_match: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_branch_protection_rules_serialize( + repository=repository, + branch_protection_rule=branch_protection_rule, + if_match=if_match, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method set_branch_protection_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _set_branch_protection_rules_serialize( + self, + repository, + branch_protection_rule, + if_match, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'BranchProtectionRule': '', + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) - if _params['if_match']: - _header_params['If-Match'] = _params['if_match'] - + if if_match is not None: + _header_params['If-Match'] = if_match # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['branch_protection_rule'] is not None: - _body_params = _params['branch_protection_rule'] + if branch_protection_rule is not None: + _body_params = branch_protection_rule + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/settings/branch_protection', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/settings/branch_protection', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def set_gc_rules(self, repository : StrictStr, garbage_collection_rules : GarbageCollectionRules, **kwargs) -> None: # noqa: E501 - """set_gc_rules # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_gc_rules(repository, garbage_collection_rules, async_req=True) - >>> result = thread.get() + @validate_call + def set_gc_rules( + self, + repository: StrictStr, + garbage_collection_rules: GarbageCollectionRules, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """set_gc_rules + :param repository: (required) :type repository: str :param garbage_collection_rules: (required) :type garbage_collection_rules: GarbageCollectionRules - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the set_gc_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.set_gc_rules_with_http_info(repository, garbage_collection_rules, **kwargs) # noqa: E501 - - @validate_arguments - def set_gc_rules_with_http_info(self, repository : StrictStr, garbage_collection_rules : GarbageCollectionRules, **kwargs) -> ApiResponse: # noqa: E501 - """set_gc_rules # noqa: E501 + """ # noqa: E501 + + _param = self._set_gc_rules_serialize( + repository=repository, + garbage_collection_rules=garbage_collection_rules, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def set_gc_rules_with_http_info( + self, + repository: StrictStr, + garbage_collection_rules: GarbageCollectionRules, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """set_gc_rules - >>> thread = api.set_gc_rules_with_http_info(repository, garbage_collection_rules, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param garbage_collection_rules: (required) :type garbage_collection_rules: GarbageCollectionRules - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._set_gc_rules_serialize( + repository=repository, + garbage_collection_rules=garbage_collection_rules, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'repository', - 'garbage_collection_rules' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def set_gc_rules_without_preload_content( + self, + repository: StrictStr, + garbage_collection_rules: GarbageCollectionRules, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """set_gc_rules + + + :param repository: (required) + :type repository: str + :param garbage_collection_rules: (required) + :type garbage_collection_rules: GarbageCollectionRules + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._set_gc_rules_serialize( + repository=repository, + garbage_collection_rules=garbage_collection_rules, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method set_gc_rules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _set_gc_rules_serialize( + self, + repository, + garbage_collection_rules, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['garbage_collection_rules'] is not None: - _body_params = _params['garbage_collection_rules'] + if garbage_collection_rules is not None: + _body_params = garbage_collection_rules + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/settings/gc_rules', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/settings/gc_rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/staging_api.py b/clients/python/lakefs_sdk/api/staging_api.py index e689bf6da03..079f761d0ee 100644 --- a/clients/python/lakefs_sdk/api/staging_api.py +++ b/clients/python/lakefs_sdk/api/staging_api.py @@ -12,57 +12,64 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: from pydantic.v1 import Field, StrictBool, StrictStr except ImportError: from pydantic import Field, StrictBool, StrictStr - from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.models.staging_location import StagingLocation from lakefs_sdk.models.staging_metadata import StagingMetadata -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class StagingApi(object): +class StagingApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_physical_address(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], presign : Optional[StrictBool] = None, **kwargs) -> StagingLocation: # noqa: E501 - """generate an address to which the client can upload an object # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_physical_address( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StagingLocation: + """generate an address to which the client can upload an object - >>> thread = api.get_physical_address(repository, branch, path, presign, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -72,31 +79,78 @@ def get_physical_address(self, repository : StrictStr, branch : StrictStr, path :type path: str :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StagingLocation - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_physical_address_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_physical_address_with_http_info(repository, branch, path, presign, **kwargs) # noqa: E501 - - @validate_arguments - def get_physical_address_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], presign : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """generate an address to which the client can upload an object # noqa: E501 + """ # noqa: E501 + + _param = self._get_physical_address_serialize( + repository=repository, + branch=branch, + path=path, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StagingLocation", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_physical_address_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StagingLocation]: + """generate an address to which the client can upload an object - >>> thread = api.get_physical_address_with_http_info(repository, branch, path, presign, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -106,128 +160,236 @@ def get_physical_address_with_http_info(self, repository : StrictStr, branch : S :type path: str :param presign: :type presign: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StagingLocation, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'path', - 'presign' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_physical_address_serialize( + repository=repository, + branch=branch, + path=path, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_physical_address" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StagingLocation", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def get_physical_address_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + presign: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """generate an address to which the client can upload an object + + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param presign: + :type presign: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_physical_address_serialize( + repository=repository, + branch=branch, + path=path, + presign=presign, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['branch']: - _path_params['branch'] = _params['branch'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StagingLocation", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + def _get_physical_address_serialize( + self, + repository, + branch, + path, + presign, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params.get('presign') is not None: # noqa: E501 - _query_params.append(('presign', _params['presign'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + + if presign is not None: + + _query_params.append(('presign', presign)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "StagingLocation", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/backing', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/branches/{branch}/staging/backing', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def link_physical_address(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], staging_metadata : StagingMetadata, if_none_match : Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, **kwargs) -> ObjectStats: # noqa: E501 - """associate staging on this physical address with a path # noqa: E501 - Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.link_physical_address(repository, branch, path, staging_metadata, if_none_match, async_req=True) - >>> result = thread.get() + @validate_call + def link_physical_address( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + staging_metadata: StagingMetadata, + if_none_match: Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ObjectStats: + """associate staging on this physical address with a path + + Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace. :param repository: (required) :type repository: str @@ -239,32 +401,85 @@ def link_physical_address(self, repository : StrictStr, branch : StrictStr, path :type staging_metadata: StagingMetadata :param if_none_match: Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. :type if_none_match: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ObjectStats - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the link_physical_address_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.link_physical_address_with_http_info(repository, branch, path, staging_metadata, if_none_match, **kwargs) # noqa: E501 - - @validate_arguments - def link_physical_address_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], staging_metadata : StagingMetadata, if_none_match : Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """associate staging on this physical address with a path # noqa: E501 - - Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.link_physical_address_with_http_info(repository, branch, path, staging_metadata, if_none_match, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._link_physical_address_serialize( + repository=repository, + branch=branch, + path=path, + staging_metadata=staging_metadata, + if_none_match=if_none_match, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "StagingLocation", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def link_physical_address_with_http_info( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + staging_metadata: StagingMetadata, + if_none_match: Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ObjectStats]: + """associate staging on this physical address with a path + + Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace. :param repository: (required) :type repository: str @@ -276,129 +491,235 @@ def link_physical_address_with_http_info(self, repository : StrictStr, branch : :type staging_metadata: StagingMetadata :param if_none_match: Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. :type if_none_match: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'branch', - 'path', - 'staging_metadata', - 'if_none_match' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._link_physical_address_serialize( + repository=repository, + branch=branch, + path=path, + staging_metadata=staging_metadata, + if_none_match=if_none_match, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "StagingLocation", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def link_physical_address_without_preload_content( + self, + repository: StrictStr, + branch: StrictStr, + path: Annotated[StrictStr, Field(description="relative to the branch")], + staging_metadata: StagingMetadata, + if_none_match: Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """associate staging on this physical address with a path + + Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace. + + :param repository: (required) + :type repository: str + :param branch: (required) + :type branch: str + :param path: relative to the branch (required) + :type path: str + :param staging_metadata: (required) + :type staging_metadata: StagingMetadata + :param if_none_match: Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. + :type if_none_match: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._link_physical_address_serialize( + repository=repository, + branch=branch, + path=path, + staging_metadata=staging_metadata, + if_none_match=if_none_match, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method link_physical_address" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStats", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "StagingLocation", + '412': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _link_physical_address_serialize( + self, + repository, + branch, + path, + staging_metadata, + if_none_match, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['branch']: - _path_params['branch'] = _params['branch'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('path') is not None: # noqa: E501 - _query_params.append(('path', _params['path'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if branch is not None: + _path_params['branch'] = branch + # process the query parameters + if path is not None: + + _query_params.append(('path', path)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) - if _params['if_none_match']: - _header_params['If-None-Match'] = _params['if_none_match'] - + if if_none_match is not None: + _header_params['If-None-Match'] = if_none_match # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['staging_metadata'] is not None: - _body_params = _params['staging_metadata'] + if staging_metadata is not None: + _body_params = staging_metadata + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '200': "ObjectStats", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '409': "StagingLocation", - '412': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/branches/{branch}/staging/backing', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/repositories/{repository}/branches/{branch}/staging/backing', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api/tags_api.py b/clients/python/lakefs_sdk/api/tags_api.py index a6d6150549a..5a4e194d5ff 100644 --- a/clients/python/lakefs_sdk/api/tags_api.py +++ b/clients/python/lakefs_sdk/api/tags_api.py @@ -12,215 +12,369 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - try: - from pydantic.v1 import validate_arguments, ValidationError + from pydantic.v1 import validate_call, Field, StrictFloat, StrictStr, StrictInt except ImportError: - from pydantic import validate_arguments, ValidationError + from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated try: - from pydantic.v1 import Field, StrictBool, StrictStr, conint + from pydantic.v1 import Field, StrictBool, StrictStr except ImportError: - from pydantic import Field, StrictBool, StrictStr, conint - + from pydantic import Field, StrictBool, StrictStr from typing import Optional - +from typing_extensions import Annotated from lakefs_sdk.models.ref import Ref from lakefs_sdk.models.ref_list import RefList from lakefs_sdk.models.tag_creation import TagCreation -from lakefs_sdk.api_client import ApiClient +from lakefs_sdk.api_client import ApiClient, RequestSerialized from lakefs_sdk.api_response import ApiResponse -from lakefs_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from lakefs_sdk.rest import RESTResponseType -class TagsApi(object): +class TagsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_tag(self, repository : StrictStr, tag_creation : TagCreation, **kwargs) -> Ref: # noqa: E501 - """create tag # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_tag( + self, + repository: StrictStr, + tag_creation: TagCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Ref: + """create tag - >>> thread = api.create_tag(repository, tag_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param tag_creation: (required) :type tag_creation: TagCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Ref - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_tag_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.create_tag_with_http_info(repository, tag_creation, **kwargs) # noqa: E501 - - @validate_arguments - def create_tag_with_http_info(self, repository : StrictStr, tag_creation : TagCreation, **kwargs) -> ApiResponse: # noqa: E501 - """create tag # noqa: E501 + """ # noqa: E501 + + _param = self._create_tag_serialize( + repository=repository, + tag_creation=tag_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '201': "Ref", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_tag_with_http_info( + self, + repository: StrictStr, + tag_creation: TagCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Ref]: + """create tag - >>> thread = api.create_tag_with_http_info(repository, tag_creation, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param tag_creation: (required) :type tag_creation: TagCreation - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Ref, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_tag_serialize( + repository=repository, + tag_creation=tag_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '201': "Ref", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'tag_creation' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_tag_without_preload_content( + self, + repository: StrictStr, + tag_creation: TagCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create tag + + + :param repository: (required) + :type repository: str + :param tag_creation: (required) + :type tag_creation: TagCreation + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_tag_serialize( + repository=repository, + tag_creation=tag_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_tag" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '201': "Ref", + '400': "Error", + '401': "Error", + '403': "Error", + '404': "Error", + '409': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _create_tag_serialize( + self, + repository, + tag_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if repository is not None: + _path_params['repository'] = repository # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['tag_creation'] is not None: - _body_params = _params['tag_creation'] + if tag_creation is not None: + _body_params = tag_creation + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - - _response_types_map = { - '201': "Ref", - '400': "Error", - '401': "Error", - '403': "Error", - '404': "Error", - '409': "Error", - '420': None, - } + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/tags', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/repositories/{repository}/tags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_tag(self, repository : StrictStr, tag : StrictStr, force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 - """delete tag # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag(repository, tag, force, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_tag( + self, + repository: StrictStr, + tag: StrictStr, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete tag + :param repository: (required) :type repository: str @@ -228,31 +382,77 @@ def delete_tag(self, repository : StrictStr, tag : StrictStr, force : Optional[S :type tag: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_tag_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.delete_tag_with_http_info(repository, tag, force, **kwargs) # noqa: E501 - - @validate_arguments - def delete_tag_with_http_info(self, repository : StrictStr, tag : StrictStr, force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 - """delete tag # noqa: E501 + """ # noqa: E501 + + _param = self._delete_tag_serialize( + repository=repository, + tag=tag, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_tag_with_http_info( + self, + repository: StrictStr, + tag: StrictStr, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete tag - >>> thread = api.delete_tag_with_http_info(repository, tag, force, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -260,266 +460,510 @@ def delete_tag_with_http_info(self, repository : StrictStr, tag : StrictStr, for :type tag: str :param force: :type force: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_tag_serialize( + repository=repository, + tag=tag, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'tag', - 'force' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_tag_without_preload_content( + self, + repository: StrictStr, + tag: StrictStr, + force: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete tag + + + :param repository: (required) + :type repository: str + :param tag: (required) + :type tag: str + :param force: + :type force: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_tag_serialize( + repository=repository, + tag=tag, + force=force, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _delete_tag_serialize( + self, + repository, + tag, + force, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['tag']: - _path_params['tag'] = _params['tag'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - if _params.get('force') is not None: # noqa: E501 - _query_params.append(('force', _params['force'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if tag is not None: + _path_params['tag'] = tag + # process the query parameters + if force is not None: + + _query_params.append(('force', force)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/tags/{tag}', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='DELETE', + resource_path='/repositories/{repository}/tags/{tag}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_tag(self, repository : StrictStr, tag : StrictStr, **kwargs) -> Ref: # noqa: E501 - """get tag # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tag(repository, tag, async_req=True) - >>> result = thread.get() + @validate_call + def get_tag( + self, + repository: StrictStr, + tag: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Ref: + """get tag + :param repository: (required) :type repository: str :param tag: (required) :type tag: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Ref - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_tag_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.get_tag_with_http_info(repository, tag, **kwargs) # noqa: E501 - - @validate_arguments - def get_tag_with_http_info(self, repository : StrictStr, tag : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """get tag # noqa: E501 + """ # noqa: E501 + + _param = self._get_tag_serialize( + repository=repository, + tag=tag, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "Ref", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_tag_with_http_info( + self, + repository: StrictStr, + tag: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Ref]: + """get tag - >>> thread = api.get_tag_with_http_info(repository, tag, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str :param tag: (required) :type tag: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Ref, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_tag_serialize( + repository=repository, + tag=tag, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "Ref", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'repository', - 'tag' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_tag_without_preload_content( + self, + repository: StrictStr, + tag: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get tag + + + :param repository: (required) + :type repository: str + :param tag: (required) + :type tag: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_tag_serialize( + repository=repository, + tag=tag, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tag" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Ref", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + def _get_tag_serialize( + self, + repository, + tag, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['tag']: - _path_params['tag'] = _params['tag'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + if tag is not None: + _path_params['tag'] = tag # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "Ref", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/tags/{tag}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/tags/{tag}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_tags(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> RefList: # noqa: E501 - """list tags # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_tags(repository, prefix, after, amount, async_req=True) - >>> result = thread.get() + @validate_call + def list_tags( + self, + repository: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RefList: + """list tags + :param repository: (required) :type repository: str @@ -529,31 +973,78 @@ def list_tags(self, repository : StrictStr, prefix : Annotated[Optional[StrictSt :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: RefList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the list_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.list_tags_with_http_info(repository, prefix, after, amount, **kwargs) # noqa: E501 - - @validate_arguments - def list_tags_with_http_info(self, repository : StrictStr, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """list tags # noqa: E501 + """ # noqa: E501 + + _param = self._list_tags_serialize( + repository=repository, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "RefList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_tags_with_http_info( + self, + repository: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RefList]: + """list tags - >>> thread = api.list_tags_with_http_info(repository, prefix, after, amount, async_req=True) - >>> result = thread.get() :param repository: (required) :type repository: str @@ -563,114 +1054,209 @@ def list_tags_with_http_info(self, repository : StrictStr, prefix : Annotated[Op :type after: str :param amount: how many items to return :type amount: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(RefList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'repository', - 'prefix', - 'after', - 'amount' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_tags_serialize( + repository=repository, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_tags" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "RefList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['repository']: - _path_params['repository'] = _params['repository'] + @validate_call + def list_tags_without_preload_content( + self, + repository: StrictStr, + prefix: Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, + after: Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, + amount: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=-1)]], Field(description="how many items to return")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list tags - # process the query parameters - _query_params = [] - if _params.get('prefix') is not None: # noqa: E501 - _query_params.append(('prefix', _params['prefix'])) + :param repository: (required) + :type repository: str + :param prefix: return items prefixed with this value + :type prefix: str + :param after: return items after this value + :type after: str + :param amount: how many items to return + :type amount: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_tags_serialize( + repository=repository, + prefix=prefix, + after=after, + amount=amount, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('after') is not None: # noqa: E501 - _query_params.append(('after', _params['after'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "RefList", + '401': "Error", + '404': "Error", + '420': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_tags_serialize( + self, + repository, + prefix, + after, + amount, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('amount') is not None: # noqa: E501 - _query_params.append(('amount', _params['amount'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if repository is not None: + _path_params['repository'] = repository + # process the query parameters + if prefix is not None: + + _query_params.append(('prefix', prefix)) + + if after is not None: + + _query_params.append(('after', after)) + + if amount is not None: + + _query_params.append(('amount', amount)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 - _response_types_map = { - '200': "RefList", - '401': "Error", - '404': "Error", - '420': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token' + ] - return self.api_client.call_api( - '/repositories/{repository}/tags', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/repositories/{repository}/tags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/clients/python/lakefs_sdk/api_client.py b/clients/python/lakefs_sdk/api_client.py index 9ce808926ab..9927c33eff9 100644 --- a/clients/python/lakefs_sdk/api_client.py +++ b/clients/python/lakefs_sdk/api_client.py @@ -13,26 +13,40 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +try: + from pydantic.v1 import SecretStr +except ImportError: + from pydantic import SecretStr from lakefs_sdk.configuration import Configuration -from lakefs_sdk.api_response import ApiResponse +from lakefs_sdk.api_response import ApiResponse, T as ApiResponseT import lakefs_sdk.models from lakefs_sdk import rest -from lakefs_sdk.exceptions import ApiValueError, ApiException - - -class ApiClient(object): +from lakefs_sdk.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -46,8 +60,6 @@ class ApiClient(object): the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) @@ -59,17 +71,22 @@ class ApiClient(object): 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -84,25 +101,7 @@ def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -143,13 +142,42 @@ def set_default(cls, default): """ cls._default = default - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -160,14 +188,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -179,22 +210,30 @@ def __call_api( if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( - header_params, query_params, auth_settings, - resource_path, method, body, - request_auth=_request_auth) + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -203,64 +242,109 @@ def __call_api( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, - collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data - - return_data = None # assuming derialization is not needed - # data needs deserialization or returns HTTP data (deserialized) only - if _preload_content or _return_http_data_only: - response_type = response_types_map.get(str(response_data.status), None) - - if response_type == "bytearray": - response_data.data = response_data.data - else: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type == "bytearray": - return_data = response_data.data - elif response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return return_data - else: - return ApiResponse(status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data) + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -270,18 +354,26 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -289,30 +381,45 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = obj.to_dict() + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif content_type.startswith("application/json"): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif content_type.startswith("text/plain"): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -327,14 +434,18 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -352,138 +463,13 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None, _preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.get_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.head_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.options_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.post_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.put_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.patch_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.delete_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -491,10 +477,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -521,21 +507,21 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, (int, float)): - v = str(v) + for k, v in params.items() if isinstance(params, dict) else params: if isinstance(v, bool): v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) if isinstance(v, dict): v = json.dumps(v) if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, str(value)) for value in v) else: if collection_format == 'ssv': delimiter = ' ' @@ -546,44 +532,47 @@ def parameters_to_url_query(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(quote(str(value)) for value in v))) + (k, delimiter.join(quote(str(value)) for value in v)) + ) else: new_params.append((k, quote(str(v)))) - return "&".join(["=".join(item) for item in new_params]) + return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters(self, files: Dict[str, Union[str, bytes]]): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None for accept in accepts: if re.search('json', accept, re.IGNORECASE): @@ -606,9 +595,16 @@ def select_header_content_type(self, content_types): return content_types[0] - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, - request_auth=None): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -625,21 +621,36 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, - resource_path, method, body, - request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, - resource_path, method, body, - auth_setting) - - def _apply_auth_params(self, headers, queries, - resource_path, method, body, - auth_setting): + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -668,6 +679,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -677,8 +691,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -745,6 +763,24 @@ def __deserialize_datetime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/clients/python/lakefs_sdk/api_response.py b/clients/python/lakefs_sdk/api_response.py index 66e5192ce98..6c128431940 100644 --- a/clients/python/lakefs_sdk/api_response.py +++ b/clients/python/lakefs_sdk/api_response.py @@ -1,28 +1,24 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional +from typing import Optional, Generic, Mapping, TypeVar try: - from pydantic.v1 import Field, StrictInt, StrictStr + from pydantic.v1 import Field, StrictInt, StrictBytes, BaseModel except ImportError: - from pydantic import Field, StrictInt, StrictStr + from pydantic import Field, StrictInt, StrictBytes, BaseModel -class ApiResponse: +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): """ API response object """ - status_code: Optional[StrictInt] = Field(None, description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") - data: Optional[Any] = Field(None, description="Deserialized data given the data type") - raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - def __init__(self, - status_code=None, - headers=None, - data=None, - raw_data=None): - self.status_code = status_code - self.headers = headers - self.data = data - self.raw_data = raw_data + model_config = { + "arbitrary_types_allowed": True + } diff --git a/clients/python/lakefs_sdk/configuration.py b/clients/python/lakefs_sdk/configuration.py index 201334aba2a..8525896f1aa 100644 --- a/clients/python/lakefs_sdk/configuration.py +++ b/clients/python/lakefs_sdk/configuration.py @@ -15,12 +15,13 @@ import copy import logging +from logging import FileHandler import multiprocessing import sys +from typing import Optional import urllib3 import http.client as httplib -from lakefs_sdk.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -28,10 +29,13 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): +class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -50,9 +54,11 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: @@ -100,8 +106,12 @@ def __init__(self, host=None, access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, ssl_ca_cert=None, - ): + retries=None, + *, + debug: Optional[bool] = None + ) -> None: """Constructor """ self._base_path = "/api/v1" if host is None else host @@ -115,6 +125,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -152,13 +165,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -192,7 +208,7 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None @@ -201,7 +217,7 @@ def __init__(self, host=None, self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation diff --git a/clients/python/lakefs_sdk/exceptions.py b/clients/python/lakefs_sdk/exceptions.py index ca418efa984..c49ffc35bf8 100644 --- a/clients/python/lakefs_sdk/exceptions.py +++ b/clients/python/lakefs_sdk/exceptions.py @@ -12,6 +12,8 @@ Do not edit the class manually. """ # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -19,7 +21,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -47,7 +49,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -65,7 +67,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -84,7 +86,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -102,17 +104,56 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -122,38 +163,30 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message + class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py b/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py index c138002a2c9..27832a8fadb 100644 --- a/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py +++ b/clients/python/lakefs_sdk/models/abort_presign_multipart_upload.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class AbortPresignMultipartUpload(BaseModel): """ AbortPresignMultipartUpload - """ - physical_address: StrictStr = Field(...) - __properties = ["physical_address"] + """ # noqa: E501 + physical_address: StrictStr + __properties: ClassVar[List[str]] = ["physical_address"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AbortPresignMultipartUpload: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AbortPresignMultipartUpload from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> AbortPresignMultipartUpload: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AbortPresignMultipartUpload from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AbortPresignMultipartUpload.parse_obj(obj) + return cls.model_validate(obj) - _obj = AbortPresignMultipartUpload.parse_obj({ + _obj = cls.model_validate({ "physical_address": obj.get("physical_address") }) return _obj diff --git a/clients/python/lakefs_sdk/models/access_key_credentials.py b/clients/python/lakefs_sdk/models/access_key_credentials.py index 7d061b8777b..1266a53535b 100644 --- a/clients/python/lakefs_sdk/models/access_key_credentials.py +++ b/clients/python/lakefs_sdk/models/access_key_credentials.py @@ -18,57 +18,74 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, constr + from pydantic.v1 import BaseModel, ConfigDict, Field except ImportError: - from pydantic import BaseModel, Field, constr + from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class AccessKeyCredentials(BaseModel): """ AccessKeyCredentials - """ - access_key_id: constr(strict=True, min_length=1) = Field(..., description="access key ID to set for user for use in integration testing.") - secret_access_key: constr(strict=True, min_length=1) = Field(..., description="secret access key to set for user for use in integration testing.") - __properties = ["access_key_id", "secret_access_key"] + """ # noqa: E501 + access_key_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="access key ID to set for user for use in integration testing.") + secret_access_key: Annotated[str, Field(min_length=1, strict=True)] = Field(description="secret access key to set for user for use in integration testing.") + __properties: ClassVar[List[str]] = ["access_key_id", "secret_access_key"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AccessKeyCredentials: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AccessKeyCredentials from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> AccessKeyCredentials: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AccessKeyCredentials from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AccessKeyCredentials.parse_obj(obj) + return cls.model_validate(obj) - _obj = AccessKeyCredentials.parse_obj({ + _obj = cls.model_validate({ "access_key_id": obj.get("access_key_id"), "secret_access_key": obj.get("secret_access_key") }) diff --git a/clients/python/lakefs_sdk/models/acl.py b/clients/python/lakefs_sdk/models/acl.py index 0e66ed2d9da..ae0f8e8720b 100644 --- a/clients/python/lakefs_sdk/models/acl.py +++ b/clients/python/lakefs_sdk/models/acl.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ACL(BaseModel): """ ACL - """ - permission: StrictStr = Field(..., description="Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. ") - __properties = ["permission"] + """ # noqa: E501 + permission: StrictStr = Field(description="Permission level to give this ACL. \"Read\", \"Write\", \"Super\" and \"Admin\" are all supported. ") + __properties: ClassVar[List[str]] = ["permission"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ACL: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ACL from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ACL: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ACL from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ACL.parse_obj(obj) + return cls.model_validate(obj) - _obj = ACL.parse_obj({ + _obj = cls.model_validate({ "permission": obj.get("permission") }) return _obj diff --git a/clients/python/lakefs_sdk/models/action_run.py b/clients/python/lakefs_sdk/models/action_run.py index b1255325ca6..6a6e59a0456 100644 --- a/clients/python/lakefs_sdk/models/action_run.py +++ b/clients/python/lakefs_sdk/models/action_run.py @@ -19,68 +19,85 @@ import json from datetime import datetime -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictStr, validator + from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ActionRun(BaseModel): """ ActionRun - """ - run_id: StrictStr = Field(...) - branch: StrictStr = Field(...) - start_time: datetime = Field(...) + """ # noqa: E501 + run_id: StrictStr + branch: StrictStr + start_time: datetime end_time: Optional[datetime] = None - event_type: StrictStr = Field(...) - status: StrictStr = Field(...) - commit_id: StrictStr = Field(...) - __properties = ["run_id", "branch", "start_time", "end_time", "event_type", "status", "commit_id"] + event_type: StrictStr + status: StrictStr + commit_id: StrictStr + __properties: ClassVar[List[str]] = ["run_id", "branch", "start_time", "end_time", "event_type", "status", "commit_id"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in ('failed', 'completed'): + if value not in set(['failed', 'completed']): raise ValueError("must be one of enum values ('failed', 'completed')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ActionRun: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ActionRun from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ActionRun: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ActionRun from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ActionRun.parse_obj(obj) + return cls.model_validate(obj) - _obj = ActionRun.parse_obj({ + _obj = cls.model_validate({ "run_id": obj.get("run_id"), "branch": obj.get("branch"), "start_time": obj.get("start_time"), diff --git a/clients/python/lakefs_sdk/models/action_run_list.py b/clients/python/lakefs_sdk/models/action_run_list.py index d354d499971..3aa462e9818 100644 --- a/clients/python/lakefs_sdk/models/action_run_list.py +++ b/clients/python/lakefs_sdk/models/action_run_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.action_run import ActionRun from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class ActionRunList(BaseModel): """ ActionRunList - """ - pagination: Pagination = Field(...) - results: conlist(ActionRun) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[ActionRun] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ActionRunList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ActionRunList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> ActionRunList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ActionRunList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ActionRunList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ActionRunList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [ActionRun.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [ActionRun.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/auth_capabilities.py b/clients/python/lakefs_sdk/models/auth_capabilities.py index c4ec58db820..30759f2669b 100644 --- a/clients/python/lakefs_sdk/models/auth_capabilities.py +++ b/clients/python/lakefs_sdk/models/auth_capabilities.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, StrictBool + from pydantic.v1 import BaseModel, ConfigDict, StrictBool except ImportError: - from pydantic import BaseModel, StrictBool + from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class AuthCapabilities(BaseModel): """ AuthCapabilities - """ + """ # noqa: E501 invite_user: Optional[StrictBool] = None forgot_password: Optional[StrictBool] = None - __properties = ["invite_user", "forgot_password"] + __properties: ClassVar[List[str]] = ["invite_user", "forgot_password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AuthCapabilities: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AuthCapabilities from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> AuthCapabilities: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AuthCapabilities from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AuthCapabilities.parse_obj(obj) + return cls.model_validate(obj) - _obj = AuthCapabilities.parse_obj({ + _obj = cls.model_validate({ "invite_user": obj.get("invite_user"), "forgot_password": obj.get("forgot_password") }) diff --git a/clients/python/lakefs_sdk/models/authentication_token.py b/clients/python/lakefs_sdk/models/authentication_token.py index 0f51d64c700..284fc8b7041 100644 --- a/clients/python/lakefs_sdk/models/authentication_token.py +++ b/clients/python/lakefs_sdk/models/authentication_token.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class AuthenticationToken(BaseModel): """ AuthenticationToken - """ - token: StrictStr = Field(..., description="a JWT token that could be used to authenticate requests") - token_expiration: Optional[StrictInt] = Field(None, description="Unix Epoch in seconds") - __properties = ["token", "token_expiration"] + """ # noqa: E501 + token: StrictStr = Field(description="a JWT token that could be used to authenticate requests") + token_expiration: Optional[StrictInt] = Field(default=None, description="Unix Epoch in seconds") + __properties: ClassVar[List[str]] = ["token", "token_expiration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AuthenticationToken: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AuthenticationToken from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> AuthenticationToken: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AuthenticationToken from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AuthenticationToken.parse_obj(obj) + return cls.model_validate(obj) - _obj = AuthenticationToken.parse_obj({ + _obj = cls.model_validate({ "token": obj.get("token"), "token_expiration": obj.get("token_expiration") }) diff --git a/clients/python/lakefs_sdk/models/branch_creation.py b/clients/python/lakefs_sdk/models/branch_creation.py index e9db41e4bea..6e2ae31dcc2 100644 --- a/clients/python/lakefs_sdk/models/branch_creation.py +++ b/clients/python/lakefs_sdk/models/branch_creation.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class BranchCreation(BaseModel): """ BranchCreation - """ - name: StrictStr = Field(...) - source: StrictStr = Field(...) + """ # noqa: E501 + name: StrictStr + source: StrictStr force: Optional[StrictBool] = False - __properties = ["name", "source", "force"] + __properties: ClassVar[List[str]] = ["name", "source", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> BranchCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of BranchCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> BranchCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of BranchCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return BranchCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = BranchCreation.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "source": obj.get("source"), "force": obj.get("force") if obj.get("force") is not None else False diff --git a/clients/python/lakefs_sdk/models/branch_protection_rule.py b/clients/python/lakefs_sdk/models/branch_protection_rule.py index 0639d5d72ac..118ecf3968c 100644 --- a/clients/python/lakefs_sdk/models/branch_protection_rule.py +++ b/clients/python/lakefs_sdk/models/branch_protection_rule.py @@ -18,56 +18,73 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, constr + from pydantic.v1 import BaseModel, ConfigDict, Field except ImportError: - from pydantic import BaseModel, Field, constr + from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class BranchProtectionRule(BaseModel): """ BranchProtectionRule - """ - pattern: constr(strict=True, min_length=1) = Field(..., description="fnmatch pattern for the branch name, supporting * and ? wildcards") - __properties = ["pattern"] + """ # noqa: E501 + pattern: Annotated[str, Field(min_length=1, strict=True)] = Field(description="fnmatch pattern for the branch name, supporting * and ? wildcards") + __properties: ClassVar[List[str]] = ["pattern"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> BranchProtectionRule: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of BranchProtectionRule from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> BranchProtectionRule: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of BranchProtectionRule from a dict""" if obj is None: return None if not isinstance(obj, dict): - return BranchProtectionRule.parse_obj(obj) + return cls.model_validate(obj) - _obj = BranchProtectionRule.parse_obj({ + _obj = cls.model_validate({ "pattern": obj.get("pattern") }) return _obj diff --git a/clients/python/lakefs_sdk/models/cherry_pick_creation.py b/clients/python/lakefs_sdk/models/cherry_pick_creation.py index 81f87fec653..ef214d83d49 100644 --- a/clients/python/lakefs_sdk/models/cherry_pick_creation.py +++ b/clients/python/lakefs_sdk/models/cherry_pick_creation.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.commit_overrides import CommitOverrides +from typing import Optional, Set +from typing_extensions import Self class CherryPickCreation(BaseModel): """ CherryPickCreation - """ - ref: StrictStr = Field(..., description="the commit to cherry-pick, given by a ref") - parent_number: Optional[StrictInt] = Field(None, description="When cherry-picking a merge commit, the parent number (starting from 1) with which to perform the diff. The default branch is parent 1. ") + """ # noqa: E501 + ref: StrictStr = Field(description="the commit to cherry-pick, given by a ref") + parent_number: Optional[StrictInt] = Field(default=None, description="When cherry-picking a merge commit, the parent number (starting from 1) with which to perform the diff. The default branch is parent 1. ") commit_overrides: Optional[CommitOverrides] = None force: Optional[StrictBool] = False - __properties = ["ref", "parent_number", "commit_overrides", "force"] + __properties: ClassVar[List[str]] = ["ref", "parent_number", "commit_overrides", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CherryPickCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CherryPickCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of commit_overrides if self.commit_overrides: _dict['commit_overrides'] = self.commit_overrides.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> CherryPickCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CherryPickCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CherryPickCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = CherryPickCreation.parse_obj({ + _obj = cls.model_validate({ "ref": obj.get("ref"), "parent_number": obj.get("parent_number"), - "commit_overrides": CommitOverrides.from_dict(obj.get("commit_overrides")) if obj.get("commit_overrides") is not None else None, + "commit_overrides": CommitOverrides.from_dict(obj["commit_overrides"]) if obj.get("commit_overrides") is not None else None, "force": obj.get("force") if obj.get("force") is not None else False }) return _obj diff --git a/clients/python/lakefs_sdk/models/comm_prefs_input.py b/clients/python/lakefs_sdk/models/comm_prefs_input.py index 93c9c2cd0e1..9a47f658f26 100644 --- a/clients/python/lakefs_sdk/models/comm_prefs_input.py +++ b/clients/python/lakefs_sdk/models/comm_prefs_input.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class CommPrefsInput(BaseModel): """ CommPrefsInput - """ - email: Optional[StrictStr] = Field(None, description="the provided email") - feature_updates: StrictBool = Field(..., alias="featureUpdates", description="user preference to receive feature updates") - security_updates: StrictBool = Field(..., alias="securityUpdates", description="user preference to receive security updates") - __properties = ["email", "featureUpdates", "securityUpdates"] + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="the provided email") + feature_updates: StrictBool = Field(description="user preference to receive feature updates", alias="featureUpdates") + security_updates: StrictBool = Field(description="user preference to receive security updates", alias="securityUpdates") + __properties: ClassVar[List[str]] = ["email", "featureUpdates", "securityUpdates"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CommPrefsInput: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CommPrefsInput from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> CommPrefsInput: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CommPrefsInput from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CommPrefsInput.parse_obj(obj) + return cls.model_validate(obj) - _obj = CommPrefsInput.parse_obj({ + _obj = cls.model_validate({ "email": obj.get("email"), - "feature_updates": obj.get("featureUpdates"), - "security_updates": obj.get("securityUpdates") + "featureUpdates": obj.get("featureUpdates"), + "securityUpdates": obj.get("securityUpdates") }) return _obj diff --git a/clients/python/lakefs_sdk/models/commit.py b/clients/python/lakefs_sdk/models/commit.py index 311b60510fe..9439de14a19 100644 --- a/clients/python/lakefs_sdk/models/commit.py +++ b/clients/python/lakefs_sdk/models/commit.py @@ -18,64 +18,81 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conint, conlist + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr, conint, conlist + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Commit(BaseModel): """ Commit - """ - id: StrictStr = Field(...) - parents: conlist(StrictStr) = Field(...) - committer: StrictStr = Field(...) - message: StrictStr = Field(...) - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - meta_range_id: StrictStr = Field(...) + """ # noqa: E501 + id: StrictStr + parents: List[StrictStr] + committer: StrictStr + message: StrictStr + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + meta_range_id: StrictStr metadata: Optional[Dict[str, StrictStr]] = None generation: Optional[StrictInt] = None - version: Optional[conint(strict=True, le=1, ge=0)] = None - __properties = ["id", "parents", "committer", "message", "creation_date", "meta_range_id", "metadata", "generation", "version"] + version: Optional[Annotated[int, Field(le=1, strict=True, ge=0)]] = None + __properties: ClassVar[List[str]] = ["id", "parents", "committer", "message", "creation_date", "meta_range_id", "metadata", "generation", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Commit: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Commit from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Commit: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Commit from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Commit.parse_obj(obj) + return cls.model_validate(obj) - _obj = Commit.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "parents": obj.get("parents"), "committer": obj.get("committer"), diff --git a/clients/python/lakefs_sdk/models/commit_creation.py b/clients/python/lakefs_sdk/models/commit_creation.py index a5ec2d926e1..ad7a04fcf0f 100644 --- a/clients/python/lakefs_sdk/models/commit_creation.py +++ b/clients/python/lakefs_sdk/models/commit_creation.py @@ -18,63 +18,79 @@ import re # noqa: F401 import json - -from typing import Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class CommitCreation(BaseModel): """ CommitCreation - """ - message: StrictStr = Field(...) + """ # noqa: E501 + message: StrictStr metadata: Optional[Dict[str, StrictStr]] = None - var_date: Optional[StrictInt] = Field(None, alias="date", description="set date to override creation date in the commit (Unix Epoch in seconds)") - allow_empty: Optional[StrictBool] = Field(False, description="sets whether a commit can contain no changes") + var_date: Optional[StrictInt] = Field(default=None, description="set date to override creation date in the commit (Unix Epoch in seconds)", alias="date") + allow_empty: Optional[StrictBool] = Field(default=False, description="sets whether a commit can contain no changes") force: Optional[StrictBool] = False - __properties = ["message", "metadata", "date", "allow_empty", "force"] + __properties: ClassVar[List[str]] = ["message", "metadata", "date", "allow_empty", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CommitCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CommitCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> CommitCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CommitCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CommitCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = CommitCreation.parse_obj({ + _obj = cls.model_validate({ "message": obj.get("message"), "metadata": obj.get("metadata"), - "var_date": obj.get("date"), + "date": obj.get("date"), "allow_empty": obj.get("allow_empty") if obj.get("allow_empty") is not None else False, "force": obj.get("force") if obj.get("force") is not None else False }) diff --git a/clients/python/lakefs_sdk/models/commit_list.py b/clients/python/lakefs_sdk/models/commit_list.py index 8effc0aedd2..39ad101c3c8 100644 --- a/clients/python/lakefs_sdk/models/commit_list.py +++ b/clients/python/lakefs_sdk/models/commit_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.commit import Commit from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class CommitList(BaseModel): """ CommitList - """ - pagination: Pagination = Field(...) - results: conlist(Commit) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Commit] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CommitList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CommitList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> CommitList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CommitList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CommitList.parse_obj(obj) + return cls.model_validate(obj) - _obj = CommitList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Commit.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Commit.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/commit_overrides.py b/clients/python/lakefs_sdk/models/commit_overrides.py index b90de6edfec..c04ed75f884 100644 --- a/clients/python/lakefs_sdk/models/commit_overrides.py +++ b/clients/python/lakefs_sdk/models/commit_overrides.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - -from typing import Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class CommitOverrides(BaseModel): """ CommitOverrides - """ - message: Optional[StrictStr] = Field(None, description="replace the commit message") - metadata: Optional[Dict[str, StrictStr]] = Field(None, description="replace the metadata of the commit") - __properties = ["message", "metadata"] + """ # noqa: E501 + message: Optional[StrictStr] = Field(default=None, description="replace the commit message") + metadata: Optional[Dict[str, StrictStr]] = Field(default=None, description="replace the metadata of the commit") + __properties: ClassVar[List[str]] = ["message", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CommitOverrides: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CommitOverrides from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> CommitOverrides: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CommitOverrides from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CommitOverrides.parse_obj(obj) + return cls.model_validate(obj) - _obj = CommitOverrides.parse_obj({ + _obj = cls.model_validate({ "message": obj.get("message"), "metadata": obj.get("metadata") }) diff --git a/clients/python/lakefs_sdk/models/commit_record_creation.py b/clients/python/lakefs_sdk/models/commit_record_creation.py index 422bec48c76..afec82e1725 100644 --- a/clients/python/lakefs_sdk/models/commit_record_creation.py +++ b/clients/python/lakefs_sdk/models/commit_record_creation.py @@ -18,65 +18,82 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class CommitRecordCreation(BaseModel): """ CommitRecordCreation - """ - commit_id: StrictStr = Field(..., description="id of the commit record") - version: conint(strict=True, le=1, ge=0) = Field(..., description="version of the commit record") - committer: StrictStr = Field(..., description="committer of the commit record") - message: StrictStr = Field(..., description="message of the commit record") - metarange_id: StrictStr = Field(..., description="metarange_id of the commit record") - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - parents: conlist(StrictStr) = Field(..., description="parents of the commit record") - metadata: Optional[Dict[str, StrictStr]] = Field(None, description="metadata of the commit record") - generation: StrictInt = Field(..., description="generation of the commit record") + """ # noqa: E501 + commit_id: StrictStr = Field(description="id of the commit record") + version: Annotated[int, Field(le=1, strict=True, ge=0)] = Field(description="version of the commit record") + committer: StrictStr = Field(description="committer of the commit record") + message: StrictStr = Field(description="message of the commit record") + metarange_id: StrictStr = Field(description="metarange_id of the commit record") + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + parents: List[StrictStr] = Field(description="parents of the commit record") + metadata: Optional[Dict[str, StrictStr]] = Field(default=None, description="metadata of the commit record") + generation: StrictInt = Field(description="generation of the commit record") force: Optional[StrictBool] = False - __properties = ["commit_id", "version", "committer", "message", "metarange_id", "creation_date", "parents", "metadata", "generation", "force"] + __properties: ClassVar[List[str]] = ["commit_id", "version", "committer", "message", "metarange_id", "creation_date", "parents", "metadata", "generation", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CommitRecordCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CommitRecordCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> CommitRecordCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CommitRecordCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CommitRecordCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = CommitRecordCreation.parse_obj({ + _obj = cls.model_validate({ "commit_id": obj.get("commit_id"), "version": obj.get("version"), "committer": obj.get("committer"), diff --git a/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py b/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py index ab356dc83e2..8c26144f475 100644 --- a/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py +++ b/clients/python/lakefs_sdk/models/complete_presign_multipart_upload.py @@ -18,69 +18,85 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.upload_part import UploadPart +from typing import Optional, Set +from typing_extensions import Self class CompletePresignMultipartUpload(BaseModel): """ CompletePresignMultipartUpload - """ - physical_address: StrictStr = Field(...) - parts: conlist(UploadPart) = Field(..., description="List of uploaded parts, should be ordered by ascending part number") + """ # noqa: E501 + physical_address: StrictStr + parts: List[UploadPart] = Field(description="List of uploaded parts, should be ordered by ascending part number") user_metadata: Optional[Dict[str, StrictStr]] = None - content_type: Optional[StrictStr] = Field(None, description="Object media type") - __properties = ["physical_address", "parts", "user_metadata", "content_type"] + content_type: Optional[StrictStr] = Field(default=None, description="Object media type") + __properties: ClassVar[List[str]] = ["physical_address", "parts", "user_metadata", "content_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CompletePresignMultipartUpload: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CompletePresignMultipartUpload from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in parts (list) _items = [] if self.parts: - for _item in self.parts: - if _item: - _items.append(_item.to_dict()) + for _item_parts in self.parts: + if _item_parts: + _items.append(_item_parts.to_dict()) _dict['parts'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> CompletePresignMultipartUpload: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CompletePresignMultipartUpload from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CompletePresignMultipartUpload.parse_obj(obj) + return cls.model_validate(obj) - _obj = CompletePresignMultipartUpload.parse_obj({ + _obj = cls.model_validate({ "physical_address": obj.get("physical_address"), - "parts": [UploadPart.from_dict(_item) for _item in obj.get("parts")] if obj.get("parts") is not None else None, + "parts": [UploadPart.from_dict(_item) for _item in obj["parts"]] if obj.get("parts") is not None else None, "user_metadata": obj.get("user_metadata"), "content_type": obj.get("content_type") }) diff --git a/clients/python/lakefs_sdk/models/config.py b/clients/python/lakefs_sdk/models/config.py index 46f91c0b1b5..9ff0494d8ca 100644 --- a/clients/python/lakefs_sdk/models/config.py +++ b/clients/python/lakefs_sdk/models/config.py @@ -18,47 +18,63 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.storage_config import StorageConfig from lakefs_sdk.models.version_config import VersionConfig +from typing import Optional, Set +from typing_extensions import Self class Config(BaseModel): """ Config - """ + """ # noqa: E501 version_config: Optional[VersionConfig] = None storage_config: Optional[StorageConfig] = None - __properties = ["version_config", "storage_config"] + __properties: ClassVar[List[str]] = ["version_config", "storage_config"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Config: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Config from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of version_config if self.version_config: _dict['version_config'] = self.version_config.to_dict() @@ -68,17 +84,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> Config: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Config from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Config.parse_obj(obj) + return cls.model_validate(obj) - _obj = Config.parse_obj({ - "version_config": VersionConfig.from_dict(obj.get("version_config")) if obj.get("version_config") is not None else None, - "storage_config": StorageConfig.from_dict(obj.get("storage_config")) if obj.get("storage_config") is not None else None + _obj = cls.model_validate({ + "version_config": VersionConfig.from_dict(obj["version_config"]) if obj.get("version_config") is not None else None, + "storage_config": StorageConfig.from_dict(obj["storage_config"]) if obj.get("storage_config") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/credentials.py b/clients/python/lakefs_sdk/models/credentials.py index e49a5c735f2..8b8fa46d79d 100644 --- a/clients/python/lakefs_sdk/models/credentials.py +++ b/clients/python/lakefs_sdk/models/credentials.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Credentials(BaseModel): """ Credentials - """ - access_key_id: StrictStr = Field(...) - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - __properties = ["access_key_id", "creation_date"] + """ # noqa: E501 + access_key_id: StrictStr + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + __properties: ClassVar[List[str]] = ["access_key_id", "creation_date"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Credentials: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Credentials from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Credentials: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Credentials from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Credentials.parse_obj(obj) + return cls.model_validate(obj) - _obj = Credentials.parse_obj({ + _obj = cls.model_validate({ "access_key_id": obj.get("access_key_id"), "creation_date": obj.get("creation_date") }) diff --git a/clients/python/lakefs_sdk/models/credentials_list.py b/clients/python/lakefs_sdk/models/credentials_list.py index 9678d88df9d..5375f72ff47 100644 --- a/clients/python/lakefs_sdk/models/credentials_list.py +++ b/clients/python/lakefs_sdk/models/credentials_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.credentials import Credentials from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class CredentialsList(BaseModel): """ CredentialsList - """ - pagination: Pagination = Field(...) - results: conlist(Credentials) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Credentials] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CredentialsList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CredentialsList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> CredentialsList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CredentialsList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CredentialsList.parse_obj(obj) + return cls.model_validate(obj) - _obj = CredentialsList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Credentials.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Credentials.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/credentials_with_secret.py b/clients/python/lakefs_sdk/models/credentials_with_secret.py index d4ea483b984..122f861891e 100644 --- a/clients/python/lakefs_sdk/models/credentials_with_secret.py +++ b/clients/python/lakefs_sdk/models/credentials_with_secret.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class CredentialsWithSecret(BaseModel): """ CredentialsWithSecret - """ - access_key_id: StrictStr = Field(...) - secret_access_key: StrictStr = Field(...) - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - __properties = ["access_key_id", "secret_access_key", "creation_date"] + """ # noqa: E501 + access_key_id: StrictStr + secret_access_key: StrictStr + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + __properties: ClassVar[List[str]] = ["access_key_id", "secret_access_key", "creation_date"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CredentialsWithSecret: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CredentialsWithSecret from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> CredentialsWithSecret: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CredentialsWithSecret from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CredentialsWithSecret.parse_obj(obj) + return cls.model_validate(obj) - _obj = CredentialsWithSecret.parse_obj({ + _obj = cls.model_validate({ "access_key_id": obj.get("access_key_id"), "secret_access_key": obj.get("secret_access_key"), "creation_date": obj.get("creation_date") diff --git a/clients/python/lakefs_sdk/models/current_user.py b/clients/python/lakefs_sdk/models/current_user.py index 0927cdc7e84..2046d093c02 100644 --- a/clients/python/lakefs_sdk/models/current_user.py +++ b/clients/python/lakefs_sdk/models/current_user.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.user import User +from typing import Optional, Set +from typing_extensions import Self class CurrentUser(BaseModel): """ CurrentUser - """ - user: User = Field(...) - __properties = ["user"] + """ # noqa: E501 + user: User + __properties: ClassVar[List[str]] = ["user"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CurrentUser: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CurrentUser from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of user if self.user: _dict['user'] = self.user.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> CurrentUser: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CurrentUser from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CurrentUser.parse_obj(obj) + return cls.model_validate(obj) - _obj = CurrentUser.parse_obj({ - "user": User.from_dict(obj.get("user")) if obj.get("user") is not None else None + _obj = cls.model_validate({ + "user": User.from_dict(obj["user"]) if obj.get("user") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/diff.py b/clients/python/lakefs_sdk/models/diff.py index 88efee897e7..e2fbb5d0284 100644 --- a/clients/python/lakefs_sdk/models/diff.py +++ b/clients/python/lakefs_sdk/models/diff.py @@ -18,73 +18,89 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr, validator + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Diff(BaseModel): """ Diff - """ - type: StrictStr = Field(...) - path: StrictStr = Field(...) - path_type: StrictStr = Field(...) - size_bytes: Optional[StrictInt] = Field(None, description="represents the size of the added/changed/deleted entry") - __properties = ["type", "path", "path_type", "size_bytes"] - - @validator('type') + """ # noqa: E501 + type: StrictStr + path: StrictStr + path_type: StrictStr + size_bytes: Optional[StrictInt] = Field(default=None, description="represents the size of the added/changed/deleted entry") + __properties: ClassVar[List[str]] = ["type", "path", "path_type", "size_bytes"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('added', 'removed', 'changed', 'conflict', 'prefix_changed'): + if value not in set(['added', 'removed', 'changed', 'conflict', 'prefix_changed']): raise ValueError("must be one of enum values ('added', 'removed', 'changed', 'conflict', 'prefix_changed')") return value - @validator('path_type') + @field_validator('path_type') def path_type_validate_enum(cls, value): """Validates the enum""" - if value not in ('common_prefix', 'object'): + if value not in set(['common_prefix', 'object']): raise ValueError("must be one of enum values ('common_prefix', 'object')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Diff: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Diff from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Diff: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Diff from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Diff.parse_obj(obj) + return cls.model_validate(obj) - _obj = Diff.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), "path": obj.get("path"), "path_type": obj.get("path_type"), diff --git a/clients/python/lakefs_sdk/models/diff_list.py b/clients/python/lakefs_sdk/models/diff_list.py index 4068c89412b..95ac66836e9 100644 --- a/clients/python/lakefs_sdk/models/diff_list.py +++ b/clients/python/lakefs_sdk/models/diff_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.diff import Diff from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class DiffList(BaseModel): """ DiffList - """ - pagination: Pagination = Field(...) - results: conlist(Diff) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Diff] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> DiffList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of DiffList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> DiffList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of DiffList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return DiffList.parse_obj(obj) + return cls.model_validate(obj) - _obj = DiffList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Diff.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Diff.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/error.py b/clients/python/lakefs_sdk/models/error.py index 11d909de7e5..f3752ecd3e1 100644 --- a/clients/python/lakefs_sdk/models/error.py +++ b/clients/python/lakefs_sdk/models/error.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Error(BaseModel): """ Error - """ - message: StrictStr = Field(..., description="short message explaining the error") - __properties = ["message"] + """ # noqa: E501 + message: StrictStr = Field(description="short message explaining the error") + __properties: ClassVar[List[str]] = ["message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Error: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Error from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Error: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Error from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Error.parse_obj(obj) + return cls.model_validate(obj) - _obj = Error.parse_obj({ + _obj = cls.model_validate({ "message": obj.get("message") }) return _obj diff --git a/clients/python/lakefs_sdk/models/error_no_acl.py b/clients/python/lakefs_sdk/models/error_no_acl.py index 2e9d8736d69..f85606a14ac 100644 --- a/clients/python/lakefs_sdk/models/error_no_acl.py +++ b/clients/python/lakefs_sdk/models/error_no_acl.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ErrorNoACL(BaseModel): """ ErrorNoACL - """ - message: StrictStr = Field(..., description="short message explaining the error") - no_acl: Optional[StrictBool] = Field(None, description="true if the group exists but has no ACL") - __properties = ["message", "no_acl"] + """ # noqa: E501 + message: StrictStr = Field(description="short message explaining the error") + no_acl: Optional[StrictBool] = Field(default=None, description="true if the group exists but has no ACL") + __properties: ClassVar[List[str]] = ["message", "no_acl"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ErrorNoACL: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ErrorNoACL from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ErrorNoACL: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ErrorNoACL from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ErrorNoACL.parse_obj(obj) + return cls.model_validate(obj) - _obj = ErrorNoACL.parse_obj({ + _obj = cls.model_validate({ "message": obj.get("message"), "no_acl": obj.get("no_acl") }) diff --git a/clients/python/lakefs_sdk/models/external_login_information.py b/clients/python/lakefs_sdk/models/external_login_information.py index 9fa8c46c915..1a69974695f 100644 --- a/clients/python/lakefs_sdk/models/external_login_information.py +++ b/clients/python/lakefs_sdk/models/external_login_information.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt except ImportError: - from pydantic import BaseModel, Field, StrictInt + from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ExternalLoginInformation(BaseModel): """ ExternalLoginInformation - """ + """ # noqa: E501 token_expiration_duration: Optional[StrictInt] = None - identity_request: Dict[str, Any] = Field(..., alias="identityRequest") - __properties = ["token_expiration_duration", "identityRequest"] + identity_request: Dict[str, Any] = Field(alias="identityRequest") + __properties: ClassVar[List[str]] = ["token_expiration_duration", "identityRequest"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ExternalLoginInformation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ExternalLoginInformation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ExternalLoginInformation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ExternalLoginInformation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ExternalLoginInformation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ExternalLoginInformation.parse_obj({ + _obj = cls.model_validate({ "token_expiration_duration": obj.get("token_expiration_duration"), - "identity_request": obj.get("identityRequest") + "identityRequest": obj.get("identityRequest") }) return _obj diff --git a/clients/python/lakefs_sdk/models/external_principal.py b/clients/python/lakefs_sdk/models/external_principal.py index 039e66caf41..9b731cd899e 100644 --- a/clients/python/lakefs_sdk/models/external_principal.py +++ b/clients/python/lakefs_sdk/models/external_principal.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ExternalPrincipal(BaseModel): """ ExternalPrincipal - """ - id: StrictStr = Field(..., description="A unique identifier for the external principal i.e aws:sts::123:assumed-role/role-name") - user_id: StrictStr = Field(..., description="lakeFS user ID to associate with an external principal. ") - settings: Optional[conlist(Dict[str, StrictStr])] = None - __properties = ["id", "user_id", "settings"] + """ # noqa: E501 + id: StrictStr = Field(description="A unique identifier for the external principal i.e aws:sts::123:assumed-role/role-name") + user_id: StrictStr = Field(description="lakeFS user ID to associate with an external principal. ") + settings: Optional[List[Dict[str, StrictStr]]] = None + __properties: ClassVar[List[str]] = ["id", "user_id", "settings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ExternalPrincipal: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ExternalPrincipal from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ExternalPrincipal: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ExternalPrincipal from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ExternalPrincipal.parse_obj(obj) + return cls.model_validate(obj) - _obj = ExternalPrincipal.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "user_id": obj.get("user_id"), "settings": obj.get("settings") diff --git a/clients/python/lakefs_sdk/models/external_principal_creation.py b/clients/python/lakefs_sdk/models/external_principal_creation.py index 87d04d77ad2..a049dc590db 100644 --- a/clients/python/lakefs_sdk/models/external_principal_creation.py +++ b/clients/python/lakefs_sdk/models/external_principal_creation.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Dict, List, Optional try: - from pydantic.v1 import BaseModel, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ExternalPrincipalCreation(BaseModel): """ ExternalPrincipalCreation - """ - settings: Optional[conlist(Dict[str, StrictStr])] = None - __properties = ["settings"] + """ # noqa: E501 + settings: Optional[List[Dict[str, StrictStr]]] = None + __properties: ClassVar[List[str]] = ["settings"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ExternalPrincipalCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ExternalPrincipalCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ExternalPrincipalCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ExternalPrincipalCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ExternalPrincipalCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ExternalPrincipalCreation.parse_obj({ + _obj = cls.model_validate({ "settings": obj.get("settings") }) return _obj diff --git a/clients/python/lakefs_sdk/models/external_principal_list.py b/clients/python/lakefs_sdk/models/external_principal_list.py index 39d3d46fb48..5a3298346a8 100644 --- a/clients/python/lakefs_sdk/models/external_principal_list.py +++ b/clients/python/lakefs_sdk/models/external_principal_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.external_principal import ExternalPrincipal from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class ExternalPrincipalList(BaseModel): """ ExternalPrincipalList - """ - pagination: Pagination = Field(...) - results: conlist(ExternalPrincipal) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[ExternalPrincipal] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ExternalPrincipalList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ExternalPrincipalList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> ExternalPrincipalList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ExternalPrincipalList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ExternalPrincipalList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ExternalPrincipalList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [ExternalPrincipal.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [ExternalPrincipal.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/find_merge_base_result.py b/clients/python/lakefs_sdk/models/find_merge_base_result.py index d5bd5f5adf2..0eaea3e10be 100644 --- a/clients/python/lakefs_sdk/models/find_merge_base_result.py +++ b/clients/python/lakefs_sdk/models/find_merge_base_result.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class FindMergeBaseResult(BaseModel): """ FindMergeBaseResult - """ - source_commit_id: StrictStr = Field(..., description="The commit ID of the merge source") - destination_commit_id: StrictStr = Field(..., description="The commit ID of the merge destination") - base_commit_id: StrictStr = Field(..., description="The commit ID of the merge base") - __properties = ["source_commit_id", "destination_commit_id", "base_commit_id"] + """ # noqa: E501 + source_commit_id: StrictStr = Field(description="The commit ID of the merge source") + destination_commit_id: StrictStr = Field(description="The commit ID of the merge destination") + base_commit_id: StrictStr = Field(description="The commit ID of the merge base") + __properties: ClassVar[List[str]] = ["source_commit_id", "destination_commit_id", "base_commit_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> FindMergeBaseResult: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of FindMergeBaseResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> FindMergeBaseResult: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of FindMergeBaseResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return FindMergeBaseResult.parse_obj(obj) + return cls.model_validate(obj) - _obj = FindMergeBaseResult.parse_obj({ + _obj = cls.model_validate({ "source_commit_id": obj.get("source_commit_id"), "destination_commit_id": obj.get("destination_commit_id"), "base_commit_id": obj.get("base_commit_id") diff --git a/clients/python/lakefs_sdk/models/garbage_collection_config.py b/clients/python/lakefs_sdk/models/garbage_collection_config.py index 6ec2bff526d..fdb00b5a592 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_config.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_config.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt except ImportError: - from pydantic import BaseModel, Field, StrictInt + from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class GarbageCollectionConfig(BaseModel): """ GarbageCollectionConfig - """ - grace_period: Optional[StrictInt] = Field(None, description="Duration in seconds. Objects created in the recent grace_period will not be collected.") - __properties = ["grace_period"] + """ # noqa: E501 + grace_period: Optional[StrictInt] = Field(default=None, description="Duration in seconds. Objects created in the recent grace_period will not be collected.") + __properties: ClassVar[List[str]] = ["grace_period"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GarbageCollectionConfig: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GarbageCollectionConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> GarbageCollectionConfig: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GarbageCollectionConfig from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GarbageCollectionConfig.parse_obj(obj) + return cls.model_validate(obj) - _obj = GarbageCollectionConfig.parse_obj({ + _obj = cls.model_validate({ "grace_period": obj.get("grace_period") }) return _obj diff --git a/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py b/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py index 51353e69fdf..3909ea68d0e 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_prepare_response.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class GarbageCollectionPrepareResponse(BaseModel): """ GarbageCollectionPrepareResponse - """ - run_id: StrictStr = Field(..., description="a unique identifier generated for this GC job") - gc_commits_location: StrictStr = Field(..., description="location of the resulting commits csv table (partitioned by run_id)") - gc_addresses_location: StrictStr = Field(..., description="location to use for expired addresses parquet table (partitioned by run_id)") - gc_commits_presigned_url: Optional[StrictStr] = Field(None, description="a presigned url to download the commits csv") - __properties = ["run_id", "gc_commits_location", "gc_addresses_location", "gc_commits_presigned_url"] + """ # noqa: E501 + run_id: StrictStr = Field(description="a unique identifier generated for this GC job") + gc_commits_location: StrictStr = Field(description="location of the resulting commits csv table (partitioned by run_id)") + gc_addresses_location: StrictStr = Field(description="location to use for expired addresses parquet table (partitioned by run_id)") + gc_commits_presigned_url: Optional[StrictStr] = Field(default=None, description="a presigned url to download the commits csv") + __properties: ClassVar[List[str]] = ["run_id", "gc_commits_location", "gc_addresses_location", "gc_commits_presigned_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GarbageCollectionPrepareResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GarbageCollectionPrepareResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> GarbageCollectionPrepareResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GarbageCollectionPrepareResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GarbageCollectionPrepareResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = GarbageCollectionPrepareResponse.parse_obj({ + _obj = cls.model_validate({ "run_id": obj.get("run_id"), "gc_commits_location": obj.get("gc_commits_location"), "gc_addresses_location": obj.get("gc_addresses_location"), diff --git a/clients/python/lakefs_sdk/models/garbage_collection_rule.py b/clients/python/lakefs_sdk/models/garbage_collection_rule.py index ad971b0dea7..27833bd9c31 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_rule.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_rule.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class GarbageCollectionRule(BaseModel): """ GarbageCollectionRule - """ - branch_id: StrictStr = Field(...) - retention_days: StrictInt = Field(...) - __properties = ["branch_id", "retention_days"] + """ # noqa: E501 + branch_id: StrictStr + retention_days: StrictInt + __properties: ClassVar[List[str]] = ["branch_id", "retention_days"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GarbageCollectionRule: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GarbageCollectionRule from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> GarbageCollectionRule: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GarbageCollectionRule from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GarbageCollectionRule.parse_obj(obj) + return cls.model_validate(obj) - _obj = GarbageCollectionRule.parse_obj({ + _obj = cls.model_validate({ "branch_id": obj.get("branch_id"), "retention_days": obj.get("retention_days") }) diff --git a/clients/python/lakefs_sdk/models/garbage_collection_rules.py b/clients/python/lakefs_sdk/models/garbage_collection_rules.py index a8932ebcd9b..8f02c1cb76c 100644 --- a/clients/python/lakefs_sdk/models/garbage_collection_rules.py +++ b/clients/python/lakefs_sdk/models/garbage_collection_rules.py @@ -18,67 +18,83 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, StrictInt, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictInt except ImportError: - from pydantic import BaseModel, Field, StrictInt, conlist + from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.garbage_collection_rule import GarbageCollectionRule +from typing import Optional, Set +from typing_extensions import Self class GarbageCollectionRules(BaseModel): """ GarbageCollectionRules - """ - default_retention_days: StrictInt = Field(...) - branches: conlist(GarbageCollectionRule) = Field(...) - __properties = ["default_retention_days", "branches"] + """ # noqa: E501 + default_retention_days: StrictInt + branches: List[GarbageCollectionRule] + __properties: ClassVar[List[str]] = ["default_retention_days", "branches"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GarbageCollectionRules: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GarbageCollectionRules from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in branches (list) _items = [] if self.branches: - for _item in self.branches: - if _item: - _items.append(_item.to_dict()) + for _item_branches in self.branches: + if _item_branches: + _items.append(_item_branches.to_dict()) _dict['branches'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> GarbageCollectionRules: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GarbageCollectionRules from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GarbageCollectionRules.parse_obj(obj) + return cls.model_validate(obj) - _obj = GarbageCollectionRules.parse_obj({ + _obj = cls.model_validate({ "default_retention_days": obj.get("default_retention_days"), - "branches": [GarbageCollectionRule.from_dict(_item) for _item in obj.get("branches")] if obj.get("branches") is not None else None + "branches": [GarbageCollectionRule.from_dict(_item) for _item in obj["branches"]] if obj.get("branches") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/group.py b/clients/python/lakefs_sdk/models/group.py index a9cbbfdc374..e7513b10635 100644 --- a/clients/python/lakefs_sdk/models/group.py +++ b/clients/python/lakefs_sdk/models/group.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Group(BaseModel): """ Group - """ - id: StrictStr = Field(...) + """ # noqa: E501 + id: StrictStr name: Optional[StrictStr] = None - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - __properties = ["id", "name", "creation_date"] + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + __properties: ClassVar[List[str]] = ["id", "name", "creation_date"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Group: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Group from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Group: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Group from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Group.parse_obj(obj) + return cls.model_validate(obj) - _obj = Group.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "creation_date": obj.get("creation_date") diff --git a/clients/python/lakefs_sdk/models/group_creation.py b/clients/python/lakefs_sdk/models/group_creation.py index afd9533b94e..9aedc6101dd 100644 --- a/clients/python/lakefs_sdk/models/group_creation.py +++ b/clients/python/lakefs_sdk/models/group_creation.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class GroupCreation(BaseModel): """ GroupCreation - """ - id: StrictStr = Field(...) - __properties = ["id"] + """ # noqa: E501 + id: StrictStr + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GroupCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GroupCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> GroupCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GroupCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GroupCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = GroupCreation.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id") }) return _obj diff --git a/clients/python/lakefs_sdk/models/group_list.py b/clients/python/lakefs_sdk/models/group_list.py index a558d20e47d..ffb4ad07a8c 100644 --- a/clients/python/lakefs_sdk/models/group_list.py +++ b/clients/python/lakefs_sdk/models/group_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.group import Group from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class GroupList(BaseModel): """ GroupList - """ - pagination: Pagination = Field(...) - results: conlist(Group) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Group] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GroupList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GroupList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> GroupList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GroupList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GroupList.parse_obj(obj) + return cls.model_validate(obj) - _obj = GroupList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Group.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Group.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/hook_run.py b/clients/python/lakefs_sdk/models/hook_run.py index 861ddf9d4eb..3ee693b3475 100644 --- a/clients/python/lakefs_sdk/models/hook_run.py +++ b/clients/python/lakefs_sdk/models/hook_run.py @@ -19,67 +19,84 @@ import json from datetime import datetime -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictStr, validator + from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class HookRun(BaseModel): """ HookRun - """ - hook_run_id: StrictStr = Field(...) - action: StrictStr = Field(...) - hook_id: StrictStr = Field(...) - start_time: datetime = Field(...) + """ # noqa: E501 + hook_run_id: StrictStr + action: StrictStr + hook_id: StrictStr + start_time: datetime end_time: Optional[datetime] = None - status: StrictStr = Field(...) - __properties = ["hook_run_id", "action", "hook_id", "start_time", "end_time", "status"] + status: StrictStr + __properties: ClassVar[List[str]] = ["hook_run_id", "action", "hook_id", "start_time", "end_time", "status"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in ('failed', 'completed'): + if value not in set(['failed', 'completed']): raise ValueError("must be one of enum values ('failed', 'completed')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> HookRun: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of HookRun from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> HookRun: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of HookRun from a dict""" if obj is None: return None if not isinstance(obj, dict): - return HookRun.parse_obj(obj) + return cls.model_validate(obj) - _obj = HookRun.parse_obj({ + _obj = cls.model_validate({ "hook_run_id": obj.get("hook_run_id"), "action": obj.get("action"), "hook_id": obj.get("hook_id"), diff --git a/clients/python/lakefs_sdk/models/hook_run_list.py b/clients/python/lakefs_sdk/models/hook_run_list.py index 9fa8148ad65..89b9fe120f2 100644 --- a/clients/python/lakefs_sdk/models/hook_run_list.py +++ b/clients/python/lakefs_sdk/models/hook_run_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.hook_run import HookRun from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class HookRunList(BaseModel): """ HookRunList - """ - pagination: Pagination = Field(...) - results: conlist(HookRun) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[HookRun] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> HookRunList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of HookRunList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> HookRunList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of HookRunList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return HookRunList.parse_obj(obj) + return cls.model_validate(obj) - _obj = HookRunList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [HookRun.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [HookRun.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/import_creation.py b/clients/python/lakefs_sdk/models/import_creation.py index 1faa8f97f64..b4d54e05b5d 100644 --- a/clients/python/lakefs_sdk/models/import_creation.py +++ b/clients/python/lakefs_sdk/models/import_creation.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - -from typing import List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictBool except ImportError: - from pydantic import BaseModel, Field, StrictBool, conlist + from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.commit_creation import CommitCreation from lakefs_sdk.models.import_location import ImportLocation +from typing import Optional, Set +from typing_extensions import Self class ImportCreation(BaseModel): """ ImportCreation - """ - paths: conlist(ImportLocation) = Field(...) - commit: CommitCreation = Field(...) + """ # noqa: E501 + paths: List[ImportLocation] + commit: CommitCreation force: Optional[StrictBool] = False - __properties = ["paths", "commit", "force"] + __properties: ClassVar[List[str]] = ["paths", "commit", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImportCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImportCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in paths (list) _items = [] if self.paths: - for _item in self.paths: - if _item: - _items.append(_item.to_dict()) + for _item_paths in self.paths: + if _item_paths: + _items.append(_item_paths.to_dict()) _dict['paths'] = _items # override the default output from pydantic by calling `to_dict()` of commit if self.commit: @@ -73,17 +89,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ImportCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImportCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImportCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImportCreation.parse_obj({ - "paths": [ImportLocation.from_dict(_item) for _item in obj.get("paths")] if obj.get("paths") is not None else None, - "commit": CommitCreation.from_dict(obj.get("commit")) if obj.get("commit") is not None else None, + _obj = cls.model_validate({ + "paths": [ImportLocation.from_dict(_item) for _item in obj["paths"]] if obj.get("paths") is not None else None, + "commit": CommitCreation.from_dict(obj["commit"]) if obj.get("commit") is not None else None, "force": obj.get("force") if obj.get("force") is not None else False }) return _obj diff --git a/clients/python/lakefs_sdk/models/import_creation_response.py b/clients/python/lakefs_sdk/models/import_creation_response.py index 1b7d179e5cf..c07ec7526c2 100644 --- a/clients/python/lakefs_sdk/models/import_creation_response.py +++ b/clients/python/lakefs_sdk/models/import_creation_response.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ImportCreationResponse(BaseModel): """ ImportCreationResponse - """ - id: StrictStr = Field(..., description="The id of the import process") - __properties = ["id"] + """ # noqa: E501 + id: StrictStr = Field(description="The id of the import process") + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImportCreationResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImportCreationResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ImportCreationResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImportCreationResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImportCreationResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImportCreationResponse.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id") }) return _obj diff --git a/clients/python/lakefs_sdk/models/import_location.py b/clients/python/lakefs_sdk/models/import_location.py index 0711b07faf8..645d32c1bdc 100644 --- a/clients/python/lakefs_sdk/models/import_location.py +++ b/clients/python/lakefs_sdk/models/import_location.py @@ -18,65 +18,81 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictStr, validator + from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ImportLocation(BaseModel): """ ImportLocation - """ - type: StrictStr = Field(..., description="Path type, can either be 'common_prefix' or 'object'") - path: StrictStr = Field(..., description="A source location to a 'common_prefix' or to a single object. Must match the lakeFS installation blockstore type.") - destination: StrictStr = Field(..., description="Destination for the imported objects on the branch. Must be a relative path to the branch. If the type is an 'object', the destination is the exact object name under the branch. If the type is a 'common_prefix', the destination is the prefix under the branch. ") - __properties = ["type", "path", "destination"] + """ # noqa: E501 + type: StrictStr = Field(description="Path type, can either be 'common_prefix' or 'object'") + path: StrictStr = Field(description="A source location to a 'common_prefix' or to a single object. Must match the lakeFS installation blockstore type.") + destination: StrictStr = Field(description="Destination for the imported objects on the branch. Must be a relative path to the branch. If the type is an 'object', the destination is the exact object name under the branch. If the type is a 'common_prefix', the destination is the prefix under the branch. ") + __properties: ClassVar[List[str]] = ["type", "path", "destination"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('common_prefix', 'object'): + if value not in set(['common_prefix', 'object']): raise ValueError("must be one of enum values ('common_prefix', 'object')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImportLocation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImportLocation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ImportLocation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImportLocation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImportLocation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImportLocation.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), "path": obj.get("path"), "destination": obj.get("destination") diff --git a/clients/python/lakefs_sdk/models/import_status.py b/clients/python/lakefs_sdk/models/import_status.py index fc97e10a546..4777b46cb5e 100644 --- a/clients/python/lakefs_sdk/models/import_status.py +++ b/clients/python/lakefs_sdk/models/import_status.py @@ -19,50 +19,67 @@ import json from datetime import datetime -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.commit import Commit from lakefs_sdk.models.error import Error +from typing import Optional, Set +from typing_extensions import Self class ImportStatus(BaseModel): """ ImportStatus - """ - completed: StrictBool = Field(...) - update_time: datetime = Field(...) - ingested_objects: Optional[StrictInt] = Field(None, description="Number of objects processed so far") + """ # noqa: E501 + completed: StrictBool + update_time: datetime + ingested_objects: Optional[StrictInt] = Field(default=None, description="Number of objects processed so far") metarange_id: Optional[StrictStr] = None commit: Optional[Commit] = None error: Optional[Error] = None - __properties = ["completed", "update_time", "ingested_objects", "metarange_id", "commit", "error"] + __properties: ClassVar[List[str]] = ["completed", "update_time", "ingested_objects", "metarange_id", "commit", "error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImportStatus: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImportStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of commit if self.commit: _dict['commit'] = self.commit.to_dict() @@ -72,21 +89,21 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ImportStatus: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImportStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImportStatus.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImportStatus.parse_obj({ + _obj = cls.model_validate({ "completed": obj.get("completed"), "update_time": obj.get("update_time"), "ingested_objects": obj.get("ingested_objects"), "metarange_id": obj.get("metarange_id"), - "commit": Commit.from_dict(obj.get("commit")) if obj.get("commit") is not None else None, - "error": Error.from_dict(obj.get("error")) if obj.get("error") is not None else None + "commit": Commit.from_dict(obj["commit"]) if obj.get("commit") is not None else None, + "error": Error.from_dict(obj["error"]) if obj.get("error") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/installation_usage_report.py b/clients/python/lakefs_sdk/models/installation_usage_report.py index bcf1f26fcbc..edac7b98b57 100644 --- a/clients/python/lakefs_sdk/models/installation_usage_report.py +++ b/clients/python/lakefs_sdk/models/installation_usage_report.py @@ -18,67 +18,83 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.usage_report import UsageReport +from typing import Optional, Set +from typing_extensions import Self class InstallationUsageReport(BaseModel): """ InstallationUsageReport - """ - installation_id: StrictStr = Field(...) - reports: conlist(UsageReport) = Field(...) - __properties = ["installation_id", "reports"] + """ # noqa: E501 + installation_id: StrictStr + reports: List[UsageReport] + __properties: ClassVar[List[str]] = ["installation_id", "reports"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> InstallationUsageReport: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of InstallationUsageReport from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in reports (list) _items = [] if self.reports: - for _item in self.reports: - if _item: - _items.append(_item.to_dict()) + for _item_reports in self.reports: + if _item_reports: + _items.append(_item_reports.to_dict()) _dict['reports'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> InstallationUsageReport: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of InstallationUsageReport from a dict""" if obj is None: return None if not isinstance(obj, dict): - return InstallationUsageReport.parse_obj(obj) + return cls.model_validate(obj) - _obj = InstallationUsageReport.parse_obj({ + _obj = cls.model_validate({ "installation_id": obj.get("installation_id"), - "reports": [UsageReport.from_dict(_item) for _item in obj.get("reports")] if obj.get("reports") is not None else None + "reports": [UsageReport.from_dict(_item) for _item in obj["reports"]] if obj.get("reports") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py b/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py index eab749e1f31..6f9ace3dd04 100644 --- a/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py +++ b/clients/python/lakefs_sdk/models/internal_delete_branch_protection_rule_request.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class InternalDeleteBranchProtectionRuleRequest(BaseModel): """ InternalDeleteBranchProtectionRuleRequest - """ - pattern: StrictStr = Field(...) - __properties = ["pattern"] + """ # noqa: E501 + pattern: StrictStr + __properties: ClassVar[List[str]] = ["pattern"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> InternalDeleteBranchProtectionRuleRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of InternalDeleteBranchProtectionRuleRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> InternalDeleteBranchProtectionRuleRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of InternalDeleteBranchProtectionRuleRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return InternalDeleteBranchProtectionRuleRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = InternalDeleteBranchProtectionRuleRequest.parse_obj({ + _obj = cls.model_validate({ "pattern": obj.get("pattern") }) return _obj diff --git a/clients/python/lakefs_sdk/models/login_config.py b/clients/python/lakefs_sdk/models/login_config.py index 3509420a6ce..a1c94bdbddd 100644 --- a/clients/python/lakefs_sdk/models/login_config.py +++ b/clients/python/lakefs_sdk/models/login_config.py @@ -18,73 +18,89 @@ import re # noqa: F401 import json - -from typing import List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist, validator + from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class LoginConfig(BaseModel): """ LoginConfig - """ - rbac: Optional[StrictStr] = Field(None, alias="RBAC", description="RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. ") - login_url: StrictStr = Field(..., description="primary URL to use for login.") - login_failed_message: Optional[StrictStr] = Field(None, description="message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method ") - fallback_login_url: Optional[StrictStr] = Field(None, description="secondary URL to offer users to use for login.") - fallback_login_label: Optional[StrictStr] = Field(None, description="label to place on fallback_login_url.") - login_cookie_names: conlist(StrictStr) = Field(..., description="cookie names used to store JWT") - logout_url: StrictStr = Field(..., description="URL to use for logging out.") - __properties = ["RBAC", "login_url", "login_failed_message", "fallback_login_url", "fallback_login_label", "login_cookie_names", "logout_url"] - - @validator('rbac') + """ # noqa: E501 + rbac: Optional[StrictStr] = Field(default=None, description="RBAC will remain enabled on GUI if \"external\". That only works with an external auth service. ", alias="RBAC") + login_url: StrictStr = Field(description="primary URL to use for login.") + login_failed_message: Optional[StrictStr] = Field(default=None, description="message to display to users who fail to login; a full sentence that is rendered in HTML and may contain a link to a secondary login method ") + fallback_login_url: Optional[StrictStr] = Field(default=None, description="secondary URL to offer users to use for login.") + fallback_login_label: Optional[StrictStr] = Field(default=None, description="label to place on fallback_login_url.") + login_cookie_names: List[StrictStr] = Field(description="cookie names used to store JWT") + logout_url: StrictStr = Field(description="URL to use for logging out.") + __properties: ClassVar[List[str]] = ["RBAC", "login_url", "login_failed_message", "fallback_login_url", "fallback_login_label", "login_cookie_names", "logout_url"] + + @field_validator('rbac') def rbac_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in ('simplified', 'external'): + if value not in set(['simplified', 'external']): raise ValueError("must be one of enum values ('simplified', 'external')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> LoginConfig: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LoginConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> LoginConfig: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LoginConfig from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LoginConfig.parse_obj(obj) + return cls.model_validate(obj) - _obj = LoginConfig.parse_obj({ - "rbac": obj.get("RBAC"), + _obj = cls.model_validate({ + "RBAC": obj.get("RBAC"), "login_url": obj.get("login_url"), "login_failed_message": obj.get("login_failed_message"), "fallback_login_url": obj.get("fallback_login_url"), diff --git a/clients/python/lakefs_sdk/models/login_information.py b/clients/python/lakefs_sdk/models/login_information.py index 1a4e2fb177b..20613d085b6 100644 --- a/clients/python/lakefs_sdk/models/login_information.py +++ b/clients/python/lakefs_sdk/models/login_information.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class LoginInformation(BaseModel): """ LoginInformation - """ - access_key_id: StrictStr = Field(...) - secret_access_key: StrictStr = Field(...) - __properties = ["access_key_id", "secret_access_key"] + """ # noqa: E501 + access_key_id: StrictStr + secret_access_key: StrictStr + __properties: ClassVar[List[str]] = ["access_key_id", "secret_access_key"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> LoginInformation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LoginInformation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> LoginInformation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LoginInformation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LoginInformation.parse_obj(obj) + return cls.model_validate(obj) - _obj = LoginInformation.parse_obj({ + _obj = cls.model_validate({ "access_key_id": obj.get("access_key_id"), "secret_access_key": obj.get("secret_access_key") }) diff --git a/clients/python/lakefs_sdk/models/merge.py b/clients/python/lakefs_sdk/models/merge.py index 274f42988b3..9e7b7b205f2 100644 --- a/clients/python/lakefs_sdk/models/merge.py +++ b/clients/python/lakefs_sdk/models/merge.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - -from typing import Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Merge(BaseModel): """ Merge - """ + """ # noqa: E501 message: Optional[StrictStr] = None metadata: Optional[Dict[str, StrictStr]] = None - strategy: Optional[StrictStr] = Field(None, description="In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict") - force: Optional[StrictBool] = Field(False, description="Allow merge into a read-only branch or into a branch with the same content") - allow_empty: Optional[StrictBool] = Field(False, description="Allow merge when the branches have the same content") - __properties = ["message", "metadata", "strategy", "force", "allow_empty"] + strategy: Optional[StrictStr] = Field(default=None, description="In case of a merge conflict, this option will force the merge process to automatically favor changes from the dest branch ('dest-wins') or from the source branch('source-wins'). In case no selection is made, the merge process will fail in case of a conflict") + force: Optional[StrictBool] = Field(default=False, description="Allow merge into a read-only branch or into a branch with the same content") + allow_empty: Optional[StrictBool] = Field(default=False, description="Allow merge when the branches have the same content") + __properties: ClassVar[List[str]] = ["message", "metadata", "strategy", "force", "allow_empty"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Merge: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Merge from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Merge: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Merge from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Merge.parse_obj(obj) + return cls.model_validate(obj) - _obj = Merge.parse_obj({ + _obj = cls.model_validate({ "message": obj.get("message"), "metadata": obj.get("metadata"), "strategy": obj.get("strategy"), diff --git a/clients/python/lakefs_sdk/models/merge_result.py b/clients/python/lakefs_sdk/models/merge_result.py index 8abf6d571b1..4ee004e8b32 100644 --- a/clients/python/lakefs_sdk/models/merge_result.py +++ b/clients/python/lakefs_sdk/models/merge_result.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class MergeResult(BaseModel): """ MergeResult - """ - reference: StrictStr = Field(...) - __properties = ["reference"] + """ # noqa: E501 + reference: StrictStr + __properties: ClassVar[List[str]] = ["reference"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> MergeResult: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MergeResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> MergeResult: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MergeResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MergeResult.parse_obj(obj) + return cls.model_validate(obj) - _obj = MergeResult.parse_obj({ + _obj = cls.model_validate({ "reference": obj.get("reference") }) return _obj diff --git a/clients/python/lakefs_sdk/models/meta_range_creation.py b/clients/python/lakefs_sdk/models/meta_range_creation.py index 1543402789c..8089bc50426 100644 --- a/clients/python/lakefs_sdk/models/meta_range_creation.py +++ b/clients/python/lakefs_sdk/models/meta_range_creation.py @@ -18,65 +18,82 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict, Field except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from lakefs_sdk.models.range_metadata import RangeMetadata +from typing import Optional, Set +from typing_extensions import Self class MetaRangeCreation(BaseModel): """ MetaRangeCreation - """ - ranges: conlist(RangeMetadata, min_items=1) = Field(...) - __properties = ["ranges"] + """ # noqa: E501 + ranges: Annotated[List[RangeMetadata], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["ranges"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> MetaRangeCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaRangeCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in ranges (list) _items = [] if self.ranges: - for _item in self.ranges: - if _item: - _items.append(_item.to_dict()) + for _item_ranges in self.ranges: + if _item_ranges: + _items.append(_item_ranges.to_dict()) _dict['ranges'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> MetaRangeCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaRangeCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaRangeCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaRangeCreation.parse_obj({ - "ranges": [RangeMetadata.from_dict(_item) for _item in obj.get("ranges")] if obj.get("ranges") is not None else None + _obj = cls.model_validate({ + "ranges": [RangeMetadata.from_dict(_item) for _item in obj["ranges"]] if obj.get("ranges") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/meta_range_creation_response.py b/clients/python/lakefs_sdk/models/meta_range_creation_response.py index 621cd0f9906..3be1fc21795 100644 --- a/clients/python/lakefs_sdk/models/meta_range_creation_response.py +++ b/clients/python/lakefs_sdk/models/meta_range_creation_response.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class MetaRangeCreationResponse(BaseModel): """ MetaRangeCreationResponse - """ - id: Optional[StrictStr] = Field(None, description="The id of the created metarange") - __properties = ["id"] + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The id of the created metarange") + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> MetaRangeCreationResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaRangeCreationResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> MetaRangeCreationResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaRangeCreationResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaRangeCreationResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaRangeCreationResponse.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id") }) return _obj diff --git a/clients/python/lakefs_sdk/models/object_copy_creation.py b/clients/python/lakefs_sdk/models/object_copy_creation.py index d7a80aac5e9..1699ba0e443 100644 --- a/clients/python/lakefs_sdk/models/object_copy_creation.py +++ b/clients/python/lakefs_sdk/models/object_copy_creation.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ObjectCopyCreation(BaseModel): """ ObjectCopyCreation - """ - src_path: StrictStr = Field(..., description="path of the copied object relative to the ref") - src_ref: Optional[StrictStr] = Field(None, description="a reference, if empty uses the provided branch as ref") + """ # noqa: E501 + src_path: StrictStr = Field(description="path of the copied object relative to the ref") + src_ref: Optional[StrictStr] = Field(default=None, description="a reference, if empty uses the provided branch as ref") force: Optional[StrictBool] = False - __properties = ["src_path", "src_ref", "force"] + __properties: ClassVar[List[str]] = ["src_path", "src_ref", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ObjectCopyCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ObjectCopyCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ObjectCopyCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ObjectCopyCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ObjectCopyCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ObjectCopyCreation.parse_obj({ + _obj = cls.model_validate({ "src_path": obj.get("src_path"), "src_ref": obj.get("src_ref"), "force": obj.get("force") if obj.get("force") is not None else False diff --git a/clients/python/lakefs_sdk/models/object_error.py b/clients/python/lakefs_sdk/models/object_error.py index 14977fcaad4..d3ffda1ece2 100644 --- a/clients/python/lakefs_sdk/models/object_error.py +++ b/clients/python/lakefs_sdk/models/object_error.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ObjectError(BaseModel): """ ObjectError - """ - status_code: StrictInt = Field(..., description="HTTP status code associated for operation on path") - message: StrictStr = Field(..., description="short message explaining status_code") - path: Optional[StrictStr] = Field(None, description="affected path") - __properties = ["status_code", "message", "path"] + """ # noqa: E501 + status_code: StrictInt = Field(description="HTTP status code associated for operation on path") + message: StrictStr = Field(description="short message explaining status_code") + path: Optional[StrictStr] = Field(default=None, description="affected path") + __properties: ClassVar[List[str]] = ["status_code", "message", "path"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ObjectError: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ObjectError from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ObjectError: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ObjectError from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ObjectError.parse_obj(obj) + return cls.model_validate(obj) - _obj = ObjectError.parse_obj({ + _obj = cls.model_validate({ "status_code": obj.get("status_code"), "message": obj.get("message"), "path": obj.get("path") diff --git a/clients/python/lakefs_sdk/models/object_error_list.py b/clients/python/lakefs_sdk/models/object_error_list.py index 1f57c0d29cf..3246bfd7826 100644 --- a/clients/python/lakefs_sdk/models/object_error_list.py +++ b/clients/python/lakefs_sdk/models/object_error_list.py @@ -18,65 +18,81 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.object_error import ObjectError +from typing import Optional, Set +from typing_extensions import Self class ObjectErrorList(BaseModel): """ ObjectErrorList - """ - errors: conlist(ObjectError) = Field(...) - __properties = ["errors"] + """ # noqa: E501 + errors: List[ObjectError] + __properties: ClassVar[List[str]] = ["errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ObjectErrorList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ObjectErrorList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in errors (list) _items = [] if self.errors: - for _item in self.errors: - if _item: - _items.append(_item.to_dict()) + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) _dict['errors'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> ObjectErrorList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ObjectErrorList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ObjectErrorList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ObjectErrorList.parse_obj({ - "errors": [ObjectError.from_dict(_item) for _item in obj.get("errors")] if obj.get("errors") is not None else None + _obj = cls.model_validate({ + "errors": [ObjectError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/object_stage_creation.py b/clients/python/lakefs_sdk/models/object_stage_creation.py index 31831f9d4e4..a8fdce2a1ad 100644 --- a/clients/python/lakefs_sdk/models/object_stage_creation.py +++ b/clients/python/lakefs_sdk/models/object_stage_creation.py @@ -18,62 +18,78 @@ import re # noqa: F401 import json - -from typing import Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ObjectStageCreation(BaseModel): """ ObjectStageCreation - """ - physical_address: StrictStr = Field(...) - checksum: StrictStr = Field(...) - size_bytes: StrictInt = Field(...) - mtime: Optional[StrictInt] = Field(None, description="Unix Epoch in seconds") + """ # noqa: E501 + physical_address: StrictStr + checksum: StrictStr + size_bytes: StrictInt + mtime: Optional[StrictInt] = Field(default=None, description="Unix Epoch in seconds") metadata: Optional[Dict[str, StrictStr]] = None - content_type: Optional[StrictStr] = Field(None, description="Object media type") + content_type: Optional[StrictStr] = Field(default=None, description="Object media type") force: Optional[StrictBool] = False - __properties = ["physical_address", "checksum", "size_bytes", "mtime", "metadata", "content_type", "force"] + __properties: ClassVar[List[str]] = ["physical_address", "checksum", "size_bytes", "mtime", "metadata", "content_type", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ObjectStageCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ObjectStageCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ObjectStageCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ObjectStageCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ObjectStageCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ObjectStageCreation.parse_obj({ + _obj = cls.model_validate({ "physical_address": obj.get("physical_address"), "checksum": obj.get("checksum"), "size_bytes": obj.get("size_bytes"), diff --git a/clients/python/lakefs_sdk/models/object_stats.py b/clients/python/lakefs_sdk/models/object_stats.py index 434342171f5..baa7c152687 100644 --- a/clients/python/lakefs_sdk/models/object_stats.py +++ b/clients/python/lakefs_sdk/models/object_stats.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr, validator + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ObjectStats(BaseModel): """ ObjectStats - """ - path: StrictStr = Field(...) - path_type: StrictStr = Field(...) - physical_address: StrictStr = Field(..., description="The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET ") - physical_address_expiry: Optional[StrictInt] = Field(None, description="If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. ") - checksum: StrictStr = Field(...) - size_bytes: Optional[StrictInt] = Field(None, description="The number of bytes in the object. lakeFS always populates this field when returning ObjectStats. This field is optional _for the client_ to supply, for instance on upload. ") - mtime: StrictInt = Field(..., description="Unix Epoch in seconds") + """ # noqa: E501 + path: StrictStr + path_type: StrictStr + physical_address: StrictStr = Field(description="The location of the object on the underlying object store. Formatted as a native URI with the object store type as scheme (\"s3://...\", \"gs://...\", etc.) Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET ") + physical_address_expiry: Optional[StrictInt] = Field(default=None, description="If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. ") + checksum: StrictStr + size_bytes: Optional[StrictInt] = Field(default=None, description="The number of bytes in the object. lakeFS always populates this field when returning ObjectStats. This field is optional _for the client_ to supply, for instance on upload. ") + mtime: StrictInt = Field(description="Unix Epoch in seconds") metadata: Optional[Dict[str, StrictStr]] = None - content_type: Optional[StrictStr] = Field(None, description="Object media type") - __properties = ["path", "path_type", "physical_address", "physical_address_expiry", "checksum", "size_bytes", "mtime", "metadata", "content_type"] + content_type: Optional[StrictStr] = Field(default=None, description="Object media type") + __properties: ClassVar[List[str]] = ["path", "path_type", "physical_address", "physical_address_expiry", "checksum", "size_bytes", "mtime", "metadata", "content_type"] - @validator('path_type') + @field_validator('path_type') def path_type_validate_enum(cls, value): """Validates the enum""" - if value not in ('common_prefix', 'object'): + if value not in set(['common_prefix', 'object']): raise ValueError("must be one of enum values ('common_prefix', 'object')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ObjectStats: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ObjectStats from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ObjectStats: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ObjectStats from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ObjectStats.parse_obj(obj) + return cls.model_validate(obj) - _obj = ObjectStats.parse_obj({ + _obj = cls.model_validate({ "path": obj.get("path"), "path_type": obj.get("path_type"), "physical_address": obj.get("physical_address"), diff --git a/clients/python/lakefs_sdk/models/object_stats_list.py b/clients/python/lakefs_sdk/models/object_stats_list.py index 17651b46e26..6fc14a23274 100644 --- a/clients/python/lakefs_sdk/models/object_stats_list.py +++ b/clients/python/lakefs_sdk/models/object_stats_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.object_stats import ObjectStats from lakefs_sdk.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self class ObjectStatsList(BaseModel): """ ObjectStatsList - """ - pagination: Pagination = Field(...) - results: conlist(ObjectStats) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[ObjectStats] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ObjectStatsList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ObjectStatsList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> ObjectStatsList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ObjectStatsList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ObjectStatsList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ObjectStatsList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [ObjectStats.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [ObjectStats.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/pagination.py b/clients/python/lakefs_sdk/models/pagination.py index e6ef36a620e..3765b71571e 100644 --- a/clients/python/lakefs_sdk/models/pagination.py +++ b/clients/python/lakefs_sdk/models/pagination.py @@ -18,59 +18,76 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, conint + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr, conint + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Pagination(BaseModel): """ Pagination - """ - has_more: StrictBool = Field(..., description="Next page is available") - next_offset: StrictStr = Field(..., description="Token used to retrieve the next page") - results: conint(strict=True, ge=0) = Field(..., description="Number of values found in the results") - max_per_page: conint(strict=True, ge=0) = Field(..., description="Maximal number of entries per page") - __properties = ["has_more", "next_offset", "results", "max_per_page"] + """ # noqa: E501 + has_more: StrictBool = Field(description="Next page is available") + next_offset: StrictStr = Field(description="Token used to retrieve the next page") + results: Annotated[int, Field(strict=True, ge=0)] = Field(description="Number of values found in the results") + max_per_page: Annotated[int, Field(strict=True, ge=0)] = Field(description="Maximal number of entries per page") + __properties: ClassVar[List[str]] = ["has_more", "next_offset", "results", "max_per_page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Pagination: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Pagination from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Pagination: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Pagination from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Pagination.parse_obj(obj) + return cls.model_validate(obj) - _obj = Pagination.parse_obj({ + _obj = cls.model_validate({ "has_more": obj.get("has_more"), "next_offset": obj.get("next_offset"), "results": obj.get("results"), diff --git a/clients/python/lakefs_sdk/models/path_list.py b/clients/python/lakefs_sdk/models/path_list.py index 3a21c16c371..30142856fa4 100644 --- a/clients/python/lakefs_sdk/models/path_list.py +++ b/clients/python/lakefs_sdk/models/path_list.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class PathList(BaseModel): """ PathList - """ - paths: conlist(StrictStr) = Field(...) - __properties = ["paths"] + """ # noqa: E501 + paths: List[StrictStr] + __properties: ClassVar[List[str]] = ["paths"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PathList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PathList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PathList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PathList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PathList.parse_obj(obj) + return cls.model_validate(obj) - _obj = PathList.parse_obj({ + _obj = cls.model_validate({ "paths": obj.get("paths") }) return _obj diff --git a/clients/python/lakefs_sdk/models/policy.py b/clients/python/lakefs_sdk/models/policy.py index 656c3469abb..c2af7c123ed 100644 --- a/clients/python/lakefs_sdk/models/policy.py +++ b/clients/python/lakefs_sdk/models/policy.py @@ -18,69 +18,86 @@ import re # noqa: F401 import json - -from typing import List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from lakefs_sdk.models.statement import Statement +from typing import Optional, Set +from typing_extensions import Self class Policy(BaseModel): """ Policy - """ - id: StrictStr = Field(...) - creation_date: Optional[StrictInt] = Field(None, description="Unix Epoch in seconds") - statement: conlist(Statement, min_items=1) = Field(...) - __properties = ["id", "creation_date", "statement"] + """ # noqa: E501 + id: StrictStr + creation_date: Optional[StrictInt] = Field(default=None, description="Unix Epoch in seconds") + statement: Annotated[List[Statement], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["id", "creation_date", "statement"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Policy: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Policy from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in statement (list) _items = [] if self.statement: - for _item in self.statement: - if _item: - _items.append(_item.to_dict()) + for _item_statement in self.statement: + if _item_statement: + _items.append(_item_statement.to_dict()) _dict['statement'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> Policy: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Policy from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Policy.parse_obj(obj) + return cls.model_validate(obj) - _obj = Policy.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "creation_date": obj.get("creation_date"), - "statement": [Statement.from_dict(_item) for _item in obj.get("statement")] if obj.get("statement") is not None else None + "statement": [Statement.from_dict(_item) for _item in obj["statement"]] if obj.get("statement") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/policy_list.py b/clients/python/lakefs_sdk/models/policy_list.py index a94190afd38..b07bbecc48f 100644 --- a/clients/python/lakefs_sdk/models/policy_list.py +++ b/clients/python/lakefs_sdk/models/policy_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.policy import Policy +from typing import Optional, Set +from typing_extensions import Self class PolicyList(BaseModel): """ PolicyList - """ - pagination: Pagination = Field(...) - results: conlist(Policy) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Policy] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PolicyList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PolicyList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PolicyList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PolicyList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PolicyList.parse_obj(obj) + return cls.model_validate(obj) - _obj = PolicyList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Policy.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Policy.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py index 24224c2922e..aeab5399fcf 100644 --- a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py +++ b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_request.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PrepareGCUncommittedRequest(BaseModel): """ PrepareGCUncommittedRequest - """ + """ # noqa: E501 continuation_token: Optional[StrictStr] = None - __properties = ["continuation_token"] + __properties: ClassVar[List[str]] = ["continuation_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PrepareGCUncommittedRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PrepareGCUncommittedRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PrepareGCUncommittedRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PrepareGCUncommittedRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PrepareGCUncommittedRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PrepareGCUncommittedRequest.parse_obj({ + _obj = cls.model_validate({ "continuation_token": obj.get("continuation_token") }) return _obj diff --git a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py index 8a64efb727d..b420bdee88d 100644 --- a/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py +++ b/clients/python/lakefs_sdk/models/prepare_gc_uncommitted_response.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PrepareGCUncommittedResponse(BaseModel): """ PrepareGCUncommittedResponse - """ - run_id: StrictStr = Field(...) - gc_uncommitted_location: StrictStr = Field(..., description="location of uncommitted information data") + """ # noqa: E501 + run_id: StrictStr + gc_uncommitted_location: StrictStr = Field(description="location of uncommitted information data") continuation_token: Optional[StrictStr] = None - __properties = ["run_id", "gc_uncommitted_location", "continuation_token"] + __properties: ClassVar[List[str]] = ["run_id", "gc_uncommitted_location", "continuation_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PrepareGCUncommittedResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PrepareGCUncommittedResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PrepareGCUncommittedResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PrepareGCUncommittedResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PrepareGCUncommittedResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PrepareGCUncommittedResponse.parse_obj({ + _obj = cls.model_validate({ "run_id": obj.get("run_id"), "gc_uncommitted_location": obj.get("gc_uncommitted_location"), "continuation_token": obj.get("continuation_token") diff --git a/clients/python/lakefs_sdk/models/presign_multipart_upload.py b/clients/python/lakefs_sdk/models/presign_multipart_upload.py index 7685cbc65b2..6477b8ec316 100644 --- a/clients/python/lakefs_sdk/models/presign_multipart_upload.py +++ b/clients/python/lakefs_sdk/models/presign_multipart_upload.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class PresignMultipartUpload(BaseModel): """ PresignMultipartUpload - """ - upload_id: StrictStr = Field(...) - physical_address: StrictStr = Field(...) - presigned_urls: Optional[conlist(StrictStr)] = None - __properties = ["upload_id", "physical_address", "presigned_urls"] + """ # noqa: E501 + upload_id: StrictStr + physical_address: StrictStr + presigned_urls: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["upload_id", "physical_address", "presigned_urls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PresignMultipartUpload: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PresignMultipartUpload from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PresignMultipartUpload: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PresignMultipartUpload from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PresignMultipartUpload.parse_obj(obj) + return cls.model_validate(obj) - _obj = PresignMultipartUpload.parse_obj({ + _obj = cls.model_validate({ "upload_id": obj.get("upload_id"), "physical_address": obj.get("physical_address"), "presigned_urls": obj.get("presigned_urls") diff --git a/clients/python/lakefs_sdk/models/range_metadata.py b/clients/python/lakefs_sdk/models/range_metadata.py index b95f2007052..6fd7aeaf3e4 100644 --- a/clients/python/lakefs_sdk/models/range_metadata.py +++ b/clients/python/lakefs_sdk/models/range_metadata.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class RangeMetadata(BaseModel): """ RangeMetadata - """ - id: StrictStr = Field(..., description="ID of the range.") - min_key: StrictStr = Field(..., description="First key in the range.") - max_key: StrictStr = Field(..., description="Last key in the range.") - count: StrictInt = Field(..., description="Number of records in the range.") - estimated_size: StrictInt = Field(..., description="Estimated size of the range in bytes") - __properties = ["id", "min_key", "max_key", "count", "estimated_size"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + id: StrictStr = Field(description="ID of the range.") + min_key: StrictStr = Field(description="First key in the range.") + max_key: StrictStr = Field(description="Last key in the range.") + count: StrictInt = Field(description="Number of records in the range.") + estimated_size: StrictInt = Field(description="Estimated size of the range in bytes") + __properties: ClassVar[List[str]] = ["id", "min_key", "max_key", "count", "estimated_size"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RangeMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RangeMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RangeMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RangeMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RangeMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = RangeMetadata.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "min_key": obj.get("min_key"), "max_key": obj.get("max_key"), diff --git a/clients/python/lakefs_sdk/models/ref.py b/clients/python/lakefs_sdk/models/ref.py index 1449ae43a47..f747c9f6497 100644 --- a/clients/python/lakefs_sdk/models/ref.py +++ b/clients/python/lakefs_sdk/models/ref.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class Ref(BaseModel): """ Ref - """ - id: StrictStr = Field(...) - commit_id: StrictStr = Field(...) - __properties = ["id", "commit_id"] + """ # noqa: E501 + id: StrictStr + commit_id: StrictStr + __properties: ClassVar[List[str]] = ["id", "commit_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Ref: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Ref from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Ref: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Ref from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Ref.parse_obj(obj) + return cls.model_validate(obj) - _obj = Ref.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "commit_id": obj.get("commit_id") }) diff --git a/clients/python/lakefs_sdk/models/ref_list.py b/clients/python/lakefs_sdk/models/ref_list.py index 6282a6a185f..9324d476d49 100644 --- a/clients/python/lakefs_sdk/models/ref_list.py +++ b/clients/python/lakefs_sdk/models/ref_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.ref import Ref +from typing import Optional, Set +from typing_extensions import Self class RefList(BaseModel): """ RefList - """ - pagination: Pagination = Field(...) - results: conlist(Ref) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Ref] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RefList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RefList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> RefList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RefList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RefList.parse_obj(obj) + return cls.model_validate(obj) - _obj = RefList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Ref.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Ref.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/refs_dump.py b/clients/python/lakefs_sdk/models/refs_dump.py index 63c080601f0..4105659058f 100644 --- a/clients/python/lakefs_sdk/models/refs_dump.py +++ b/clients/python/lakefs_sdk/models/refs_dump.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class RefsDump(BaseModel): """ RefsDump - """ - commits_meta_range_id: StrictStr = Field(...) - tags_meta_range_id: StrictStr = Field(...) - branches_meta_range_id: StrictStr = Field(...) - __properties = ["commits_meta_range_id", "tags_meta_range_id", "branches_meta_range_id"] + """ # noqa: E501 + commits_meta_range_id: StrictStr + tags_meta_range_id: StrictStr + branches_meta_range_id: StrictStr + __properties: ClassVar[List[str]] = ["commits_meta_range_id", "tags_meta_range_id", "branches_meta_range_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RefsDump: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RefsDump from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RefsDump: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RefsDump from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RefsDump.parse_obj(obj) + return cls.model_validate(obj) - _obj = RefsDump.parse_obj({ + _obj = cls.model_validate({ "commits_meta_range_id": obj.get("commits_meta_range_id"), "tags_meta_range_id": obj.get("tags_meta_range_id"), "branches_meta_range_id": obj.get("branches_meta_range_id") diff --git a/clients/python/lakefs_sdk/models/refs_restore.py b/clients/python/lakefs_sdk/models/refs_restore.py index 9efb78369e3..bcf0f075446 100644 --- a/clients/python/lakefs_sdk/models/refs_restore.py +++ b/clients/python/lakefs_sdk/models/refs_restore.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class RefsRestore(BaseModel): """ RefsRestore - """ - commits_meta_range_id: StrictStr = Field(...) - tags_meta_range_id: StrictStr = Field(...) - branches_meta_range_id: StrictStr = Field(...) + """ # noqa: E501 + commits_meta_range_id: StrictStr + tags_meta_range_id: StrictStr + branches_meta_range_id: StrictStr force: Optional[StrictBool] = False - __properties = ["commits_meta_range_id", "tags_meta_range_id", "branches_meta_range_id", "force"] + __properties: ClassVar[List[str]] = ["commits_meta_range_id", "tags_meta_range_id", "branches_meta_range_id", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RefsRestore: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RefsRestore from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RefsRestore: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RefsRestore from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RefsRestore.parse_obj(obj) + return cls.model_validate(obj) - _obj = RefsRestore.parse_obj({ + _obj = cls.model_validate({ "commits_meta_range_id": obj.get("commits_meta_range_id"), "tags_meta_range_id": obj.get("tags_meta_range_id"), "branches_meta_range_id": obj.get("branches_meta_range_id"), diff --git a/clients/python/lakefs_sdk/models/repository.py b/clients/python/lakefs_sdk/models/repository.py index 44bfd179541..2f5113ca51d 100644 --- a/clients/python/lakefs_sdk/models/repository.py +++ b/clients/python/lakefs_sdk/models/repository.py @@ -18,60 +18,76 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Repository(BaseModel): """ Repository - """ - id: StrictStr = Field(...) - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - default_branch: StrictStr = Field(...) - storage_namespace: StrictStr = Field(..., description="Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\")") - read_only: Optional[StrictBool] = Field(None, description="Whether the repository is a read-only repository- not relevant for bare repositories") - __properties = ["id", "creation_date", "default_branch", "storage_namespace", "read_only"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + id: StrictStr + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + default_branch: StrictStr + storage_namespace: StrictStr = Field(description="Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\")") + read_only: Optional[StrictBool] = Field(default=None, description="Whether the repository is a read-only repository- not relevant for bare repositories") + __properties: ClassVar[List[str]] = ["id", "creation_date", "default_branch", "storage_namespace", "read_only"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Repository: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Repository from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Repository: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Repository from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Repository.parse_obj(obj) + return cls.model_validate(obj) - _obj = Repository.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "creation_date": obj.get("creation_date"), "default_branch": obj.get("default_branch"), diff --git a/clients/python/lakefs_sdk/models/repository_creation.py b/clients/python/lakefs_sdk/models/repository_creation.py index c53ace2d59b..a55ea6b558a 100644 --- a/clients/python/lakefs_sdk/models/repository_creation.py +++ b/clients/python/lakefs_sdk/models/repository_creation.py @@ -18,74 +18,91 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, constr, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr, constr, validator + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class RepositoryCreation(BaseModel): """ RepositoryCreation - """ - name: constr(strict=True) = Field(...) - storage_namespace: constr(strict=True) = Field(..., description="Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\")") + """ # noqa: E501 + name: Annotated[str, Field(strict=True)] + storage_namespace: Annotated[str, Field(strict=True)] = Field(description="Filesystem URI to store the underlying data in (e.g. \"s3://my-bucket/some/path/\")") default_branch: Optional[StrictStr] = None sample_data: Optional[StrictBool] = False read_only: Optional[StrictBool] = False - __properties = ["name", "storage_namespace", "default_branch", "sample_data", "read_only"] + __properties: ClassVar[List[str]] = ["name", "storage_namespace", "default_branch", "sample_data", "read_only"] - @validator('name') + @field_validator('name') def name_validate_regular_expression(cls, value): """Validates the regular expression""" if not re.match(r"^[a-z0-9][a-z0-9-]{2,62}$", value): raise ValueError(r"must validate the regular expression /^[a-z0-9][a-z0-9-]{2,62}$/") return value - @validator('storage_namespace') + @field_validator('storage_namespace') def storage_namespace_validate_regular_expression(cls, value): """Validates the regular expression""" if not re.match(r"^(s3|gs|https?|mem|local|transient):\/\/.*$", value): raise ValueError(r"must validate the regular expression /^(s3|gs|https?|mem|local|transient):\/\/.*$/") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RepositoryCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RepositoryCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RepositoryCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RepositoryCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RepositoryCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = RepositoryCreation.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "storage_namespace": obj.get("storage_namespace"), "default_branch": obj.get("default_branch"), diff --git a/clients/python/lakefs_sdk/models/repository_dump_status.py b/clients/python/lakefs_sdk/models/repository_dump_status.py index 6a3fb26a5a0..3326cabdb7c 100644 --- a/clients/python/lakefs_sdk/models/repository_dump_status.py +++ b/clients/python/lakefs_sdk/models/repository_dump_status.py @@ -19,68 +19,85 @@ import json from datetime import datetime -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.refs_dump import RefsDump +from typing import Optional, Set +from typing_extensions import Self class RepositoryDumpStatus(BaseModel): """ RepositoryDumpStatus - """ - id: StrictStr = Field(..., description="ID of the task") - done: StrictBool = Field(...) - update_time: datetime = Field(...) + """ # noqa: E501 + id: StrictStr = Field(description="ID of the task") + done: StrictBool + update_time: datetime error: Optional[StrictStr] = None refs: Optional[RefsDump] = None - __properties = ["id", "done", "update_time", "error", "refs"] + __properties: ClassVar[List[str]] = ["id", "done", "update_time", "error", "refs"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RepositoryDumpStatus: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RepositoryDumpStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of refs if self.refs: _dict['refs'] = self.refs.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> RepositoryDumpStatus: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RepositoryDumpStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RepositoryDumpStatus.parse_obj(obj) + return cls.model_validate(obj) - _obj = RepositoryDumpStatus.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "done": obj.get("done"), "update_time": obj.get("update_time"), "error": obj.get("error"), - "refs": RefsDump.from_dict(obj.get("refs")) if obj.get("refs") is not None else None + "refs": RefsDump.from_dict(obj["refs"]) if obj.get("refs") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/repository_list.py b/clients/python/lakefs_sdk/models/repository_list.py index 5a0e3d10a8d..bd16bc2586a 100644 --- a/clients/python/lakefs_sdk/models/repository_list.py +++ b/clients/python/lakefs_sdk/models/repository_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.repository import Repository +from typing import Optional, Set +from typing_extensions import Self class RepositoryList(BaseModel): """ RepositoryList - """ - pagination: Pagination = Field(...) - results: conlist(Repository) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[Repository] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RepositoryList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RepositoryList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> RepositoryList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RepositoryList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RepositoryList.parse_obj(obj) + return cls.model_validate(obj) - _obj = RepositoryList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [Repository.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [Repository.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/repository_metadata_keys.py b/clients/python/lakefs_sdk/models/repository_metadata_keys.py index 50b6b67841e..e554c1e5ee8 100644 --- a/clients/python/lakefs_sdk/models/repository_metadata_keys.py +++ b/clients/python/lakefs_sdk/models/repository_metadata_keys.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class RepositoryMetadataKeys(BaseModel): """ RepositoryMetadataKeys - """ - keys: conlist(StrictStr) = Field(...) - __properties = ["keys"] + """ # noqa: E501 + keys: List[StrictStr] + __properties: ClassVar[List[str]] = ["keys"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RepositoryMetadataKeys: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RepositoryMetadataKeys from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RepositoryMetadataKeys: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RepositoryMetadataKeys from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RepositoryMetadataKeys.parse_obj(obj) + return cls.model_validate(obj) - _obj = RepositoryMetadataKeys.parse_obj({ + _obj = cls.model_validate({ "keys": obj.get("keys") }) return _obj diff --git a/clients/python/lakefs_sdk/models/repository_metadata_set.py b/clients/python/lakefs_sdk/models/repository_metadata_set.py index 0d40846d095..e11b3c6de48 100644 --- a/clients/python/lakefs_sdk/models/repository_metadata_set.py +++ b/clients/python/lakefs_sdk/models/repository_metadata_set.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Dict try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class RepositoryMetadataSet(BaseModel): """ RepositoryMetadataSet - """ - metadata: Dict[str, StrictStr] = Field(...) - __properties = ["metadata"] + """ # noqa: E501 + metadata: Dict[str, StrictStr] + __properties: ClassVar[List[str]] = ["metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RepositoryMetadataSet: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RepositoryMetadataSet from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RepositoryMetadataSet: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RepositoryMetadataSet from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RepositoryMetadataSet.parse_obj(obj) + return cls.model_validate(obj) - _obj = RepositoryMetadataSet.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata") }) return _obj diff --git a/clients/python/lakefs_sdk/models/repository_restore_status.py b/clients/python/lakefs_sdk/models/repository_restore_status.py index fc9a9708b94..c2bdc4e1eb8 100644 --- a/clients/python/lakefs_sdk/models/repository_restore_status.py +++ b/clients/python/lakefs_sdk/models/repository_restore_status.py @@ -19,58 +19,75 @@ import json from datetime import datetime -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class RepositoryRestoreStatus(BaseModel): """ RepositoryRestoreStatus - """ - id: StrictStr = Field(..., description="ID of the task") - done: StrictBool = Field(...) - update_time: datetime = Field(...) + """ # noqa: E501 + id: StrictStr = Field(description="ID of the task") + done: StrictBool + update_time: datetime error: Optional[StrictStr] = None - __properties = ["id", "done", "update_time", "error"] + __properties: ClassVar[List[str]] = ["id", "done", "update_time", "error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RepositoryRestoreStatus: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RepositoryRestoreStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RepositoryRestoreStatus: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RepositoryRestoreStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RepositoryRestoreStatus.parse_obj(obj) + return cls.model_validate(obj) - _obj = RepositoryRestoreStatus.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "done": obj.get("done"), "update_time": obj.get("update_time"), diff --git a/clients/python/lakefs_sdk/models/reset_creation.py b/clients/python/lakefs_sdk/models/reset_creation.py index b29a650355f..7f7d239809b 100644 --- a/clients/python/lakefs_sdk/models/reset_creation.py +++ b/clients/python/lakefs_sdk/models/reset_creation.py @@ -18,65 +18,81 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr, validator + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ResetCreation(BaseModel): """ ResetCreation - """ - type: StrictStr = Field(..., description="What to reset according to path.") + """ # noqa: E501 + type: StrictStr = Field(description="What to reset according to path.") path: Optional[StrictStr] = None force: Optional[StrictBool] = False - __properties = ["type", "path", "force"] + __properties: ClassVar[List[str]] = ["type", "path", "force"] - @validator('type') + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in ('object', 'common_prefix', 'reset'): + if value not in set(['object', 'common_prefix', 'reset']): raise ValueError("must be one of enum values ('object', 'common_prefix', 'reset')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ResetCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResetCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ResetCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResetCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResetCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResetCreation.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), "path": obj.get("path"), "force": obj.get("force") if obj.get("force") is not None else False diff --git a/clients/python/lakefs_sdk/models/revert_creation.py b/clients/python/lakefs_sdk/models/revert_creation.py index 59e8dede99a..0bf9060cd55 100644 --- a/clients/python/lakefs_sdk/models/revert_creation.py +++ b/clients/python/lakefs_sdk/models/revert_creation.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.commit_overrides import CommitOverrides +from typing import Optional, Set +from typing_extensions import Self class RevertCreation(BaseModel): """ RevertCreation - """ - ref: StrictStr = Field(..., description="the commit to revert, given by a ref") + """ # noqa: E501 + ref: StrictStr = Field(description="the commit to revert, given by a ref") commit_overrides: Optional[CommitOverrides] = None - parent_number: StrictInt = Field(..., description="when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert.") + parent_number: StrictInt = Field(description="when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert.") force: Optional[StrictBool] = False - allow_empty: Optional[StrictBool] = Field(False, description="allow empty commit (revert without changes)") - __properties = ["ref", "commit_overrides", "parent_number", "force", "allow_empty"] + allow_empty: Optional[StrictBool] = Field(default=False, description="allow empty commit (revert without changes)") + __properties: ClassVar[List[str]] = ["ref", "commit_overrides", "parent_number", "force", "allow_empty"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RevertCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RevertCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of commit_overrides if self.commit_overrides: _dict['commit_overrides'] = self.commit_overrides.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> RevertCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RevertCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RevertCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = RevertCreation.parse_obj({ + _obj = cls.model_validate({ "ref": obj.get("ref"), - "commit_overrides": CommitOverrides.from_dict(obj.get("commit_overrides")) if obj.get("commit_overrides") is not None else None, + "commit_overrides": CommitOverrides.from_dict(obj["commit_overrides"]) if obj.get("commit_overrides") is not None else None, "parent_number": obj.get("parent_number"), "force": obj.get("force") if obj.get("force") is not None else False, "allow_empty": obj.get("allow_empty") if obj.get("allow_empty") is not None else False diff --git a/clients/python/lakefs_sdk/models/setup.py b/clients/python/lakefs_sdk/models/setup.py index 3cd1abebf7d..9ee9706f3f0 100644 --- a/clients/python/lakefs_sdk/models/setup.py +++ b/clients/python/lakefs_sdk/models/setup.py @@ -18,63 +18,79 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.access_key_credentials import AccessKeyCredentials +from typing import Optional, Set +from typing_extensions import Self class Setup(BaseModel): """ Setup - """ - username: StrictStr = Field(..., description="an identifier for the user (e.g. jane.doe)") + """ # noqa: E501 + username: StrictStr = Field(description="an identifier for the user (e.g. jane.doe)") key: Optional[AccessKeyCredentials] = None - __properties = ["username", "key"] + __properties: ClassVar[List[str]] = ["username", "key"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Setup: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Setup from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of key if self.key: _dict['key'] = self.key.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> Setup: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Setup from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Setup.parse_obj(obj) + return cls.model_validate(obj) - _obj = Setup.parse_obj({ + _obj = cls.model_validate({ "username": obj.get("username"), - "key": AccessKeyCredentials.from_dict(obj.get("key")) if obj.get("key") is not None else None + "key": AccessKeyCredentials.from_dict(obj["key"]) if obj.get("key") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/setup_state.py b/clients/python/lakefs_sdk/models/setup_state.py index 6d6c617c240..6c237f1a060 100644 --- a/clients/python/lakefs_sdk/models/setup_state.py +++ b/clients/python/lakefs_sdk/models/setup_state.py @@ -18,75 +18,91 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr, validator + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.login_config import LoginConfig +from typing import Optional, Set +from typing_extensions import Self class SetupState(BaseModel): """ SetupState - """ + """ # noqa: E501 state: Optional[StrictStr] = None - comm_prefs_missing: Optional[StrictBool] = Field(None, description="true if the comm prefs are missing.") + comm_prefs_missing: Optional[StrictBool] = Field(default=None, description="true if the comm prefs are missing.") login_config: Optional[LoginConfig] = None - __properties = ["state", "comm_prefs_missing", "login_config"] + __properties: ClassVar[List[str]] = ["state", "comm_prefs_missing", "login_config"] - @validator('state') + @field_validator('state') def state_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in ('initialized', 'not_initialized'): + if value not in set(['initialized', 'not_initialized']): raise ValueError("must be one of enum values ('initialized', 'not_initialized')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> SetupState: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SetupState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of login_config if self.login_config: _dict['login_config'] = self.login_config.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> SetupState: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SetupState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SetupState.parse_obj(obj) + return cls.model_validate(obj) - _obj = SetupState.parse_obj({ + _obj = cls.model_validate({ "state": obj.get("state"), "comm_prefs_missing": obj.get("comm_prefs_missing"), - "login_config": LoginConfig.from_dict(obj.get("login_config")) if obj.get("login_config") is not None else None + "login_config": LoginConfig.from_dict(obj["login_config"]) if obj.get("login_config") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/staging_location.py b/clients/python/lakefs_sdk/models/staging_location.py index e016c3f540c..c59350b5f77 100644 --- a/clients/python/lakefs_sdk/models/staging_location.py +++ b/clients/python/lakefs_sdk/models/staging_location.py @@ -18,63 +18,79 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StagingLocation(BaseModel): """ location for placing an object when staging it - """ + """ # noqa: E501 physical_address: Optional[StrictStr] = None - presigned_url: Optional[StrictStr] = Field(None, description="if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading") - presigned_url_expiry: Optional[StrictInt] = Field(None, description="If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. ") - __properties = ["physical_address", "presigned_url", "presigned_url_expiry"] + presigned_url: Optional[StrictStr] = Field(default=None, description="if presign=true is passed in the request, this field will contain a pre-signed URL to use when uploading") + presigned_url_expiry: Optional[StrictInt] = Field(default=None, description="If present and nonzero, physical_address is a pre-signed URL and will expire at this Unix Epoch time. This will be shorter than the pre-signed URL lifetime if an authentication token is about to expire. This field is *optional*. ") + __properties: ClassVar[List[str]] = ["physical_address", "presigned_url", "presigned_url_expiry"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StagingLocation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StagingLocation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if presigned_url (nullable) is None - # and __fields_set__ contains the field - if self.presigned_url is None and "presigned_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.presigned_url is None and "presigned_url" in self.model_fields_set: _dict['presigned_url'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StagingLocation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StagingLocation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StagingLocation.parse_obj(obj) + return cls.model_validate(obj) - _obj = StagingLocation.parse_obj({ + _obj = cls.model_validate({ "physical_address": obj.get("physical_address"), "presigned_url": obj.get("presigned_url"), "presigned_url_expiry": obj.get("presigned_url_expiry") diff --git a/clients/python/lakefs_sdk/models/staging_metadata.py b/clients/python/lakefs_sdk/models/staging_metadata.py index 26a0fe1f3d9..336266aa5cb 100644 --- a/clients/python/lakefs_sdk/models/staging_metadata.py +++ b/clients/python/lakefs_sdk/models/staging_metadata.py @@ -18,66 +18,82 @@ import re # noqa: F401 import json - -from typing import Dict, Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from lakefs_sdk.models.staging_location import StagingLocation +from typing import Optional, Set +from typing_extensions import Self class StagingMetadata(BaseModel): """ information about uploaded object - """ - staging: StagingLocation = Field(...) - checksum: StrictStr = Field(..., description="unique identifier of object content on backing store (typically ETag)") - size_bytes: StrictInt = Field(...) + """ # noqa: E501 + staging: StagingLocation + checksum: StrictStr = Field(description="unique identifier of object content on backing store (typically ETag)") + size_bytes: StrictInt user_metadata: Optional[Dict[str, StrictStr]] = None - content_type: Optional[StrictStr] = Field(None, description="Object media type") + content_type: Optional[StrictStr] = Field(default=None, description="Object media type") force: Optional[StrictBool] = False - __properties = ["staging", "checksum", "size_bytes", "user_metadata", "content_type", "force"] + __properties: ClassVar[List[str]] = ["staging", "checksum", "size_bytes", "user_metadata", "content_type", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StagingMetadata: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StagingMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of staging if self.staging: _dict['staging'] = self.staging.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> StagingMetadata: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StagingMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StagingMetadata.parse_obj(obj) + return cls.model_validate(obj) - _obj = StagingMetadata.parse_obj({ - "staging": StagingLocation.from_dict(obj.get("staging")) if obj.get("staging") is not None else None, + _obj = cls.model_validate({ + "staging": StagingLocation.from_dict(obj["staging"]) if obj.get("staging") is not None else None, "checksum": obj.get("checksum"), "size_bytes": obj.get("size_bytes"), "user_metadata": obj.get("user_metadata"), diff --git a/clients/python/lakefs_sdk/models/statement.py b/clients/python/lakefs_sdk/models/statement.py index a87fa305401..e50a995b15f 100644 --- a/clients/python/lakefs_sdk/models/statement.py +++ b/clients/python/lakefs_sdk/models/statement.py @@ -18,65 +18,82 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, StrictStr, conlist, validator + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr, field_validator except ImportError: - from pydantic import BaseModel, Field, StrictStr, conlist, validator + from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Statement(BaseModel): """ Statement - """ - effect: StrictStr = Field(...) - resource: StrictStr = Field(...) - action: conlist(StrictStr, min_items=1) = Field(...) - __properties = ["effect", "resource", "action"] + """ # noqa: E501 + effect: StrictStr + resource: StrictStr + action: Annotated[List[StrictStr], Field(min_length=1)] + __properties: ClassVar[List[str]] = ["effect", "resource", "action"] - @validator('effect') + @field_validator('effect') def effect_validate_enum(cls, value): """Validates the enum""" - if value not in ('allow', 'deny'): + if value not in set(['allow', 'deny']): raise ValueError("must be one of enum values ('allow', 'deny')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Statement: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Statement from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Statement: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Statement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Statement.parse_obj(obj) + return cls.model_validate(obj) - _obj = Statement.parse_obj({ + _obj = cls.model_validate({ "effect": obj.get("effect"), "resource": obj.get("resource"), "action": obj.get("action") diff --git a/clients/python/lakefs_sdk/models/stats_event.py b/clients/python/lakefs_sdk/models/stats_event.py index ef504d1401f..3072caa6bfc 100644 --- a/clients/python/lakefs_sdk/models/stats_event.py +++ b/clients/python/lakefs_sdk/models/stats_event.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class StatsEvent(BaseModel): """ StatsEvent - """ - var_class: StrictStr = Field(..., alias="class", description="stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\")") - name: StrictStr = Field(..., description="stats event name (e.g. \"put_object\", \"create_repository\", \"\")") - count: StrictInt = Field(..., description="number of events of the class and name") - __properties = ["class", "name", "count"] + """ # noqa: E501 + var_class: StrictStr = Field(description="stats event class (e.g. \"s3_gateway\", \"openapi_request\", \"experimental-feature\", \"ui-event\")", alias="class") + name: StrictStr = Field(description="stats event name (e.g. \"put_object\", \"create_repository\", \"\")") + count: StrictInt = Field(description="number of events of the class and name") + __properties: ClassVar[List[str]] = ["class", "name", "count"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StatsEvent: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StatsEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StatsEvent: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StatsEvent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StatsEvent.parse_obj(obj) + return cls.model_validate(obj) - _obj = StatsEvent.parse_obj({ - "var_class": obj.get("class"), + _obj = cls.model_validate({ + "class": obj.get("class"), "name": obj.get("name"), "count": obj.get("count") }) diff --git a/clients/python/lakefs_sdk/models/stats_events_list.py b/clients/python/lakefs_sdk/models/stats_events_list.py index c9b30c3a1fe..c7bcb962d3e 100644 --- a/clients/python/lakefs_sdk/models/stats_events_list.py +++ b/clients/python/lakefs_sdk/models/stats_events_list.py @@ -18,65 +18,81 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.stats_event import StatsEvent +from typing import Optional, Set +from typing_extensions import Self class StatsEventsList(BaseModel): """ StatsEventsList - """ - events: conlist(StatsEvent) = Field(...) - __properties = ["events"] + """ # noqa: E501 + events: List[StatsEvent] + __properties: ClassVar[List[str]] = ["events"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StatsEventsList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StatsEventsList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in events (list) _items = [] if self.events: - for _item in self.events: - if _item: - _items.append(_item.to_dict()) + for _item_events in self.events: + if _item_events: + _items.append(_item_events.to_dict()) _dict['events'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> StatsEventsList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StatsEventsList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StatsEventsList.parse_obj(obj) + return cls.model_validate(obj) - _obj = StatsEventsList.parse_obj({ - "events": [StatsEvent.from_dict(_item) for _item in obj.get("events")] if obj.get("events") is not None else None + _obj = cls.model_validate({ + "events": [StatsEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/storage_config.py b/clients/python/lakefs_sdk/models/storage_config.py index eddeab29b3e..764db1c4afb 100644 --- a/clients/python/lakefs_sdk/models/storage_config.py +++ b/clients/python/lakefs_sdk/models/storage_config.py @@ -18,67 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StorageConfig(BaseModel): """ StorageConfig - """ - blockstore_type: StrictStr = Field(...) - blockstore_namespace_example: StrictStr = Field(...) - blockstore_namespace_validity_regex: StrictStr = Field(..., alias="blockstore_namespace_ValidityRegex") + """ # noqa: E501 + blockstore_type: StrictStr + blockstore_namespace_example: StrictStr + blockstore_namespace_validity_regex: StrictStr = Field(alias="blockstore_namespace_ValidityRegex") default_namespace_prefix: Optional[StrictStr] = None - pre_sign_support: StrictBool = Field(...) - pre_sign_support_ui: StrictBool = Field(...) - import_support: StrictBool = Field(...) - import_validity_regex: StrictStr = Field(...) + pre_sign_support: StrictBool + pre_sign_support_ui: StrictBool + import_support: StrictBool + import_validity_regex: StrictStr pre_sign_multipart_upload: Optional[StrictBool] = None - __properties = ["blockstore_type", "blockstore_namespace_example", "blockstore_namespace_ValidityRegex", "default_namespace_prefix", "pre_sign_support", "pre_sign_support_ui", "import_support", "import_validity_regex", "pre_sign_multipart_upload"] + __properties: ClassVar[List[str]] = ["blockstore_type", "blockstore_namespace_example", "blockstore_namespace_ValidityRegex", "default_namespace_prefix", "pre_sign_support", "pre_sign_support_ui", "import_support", "import_validity_regex", "pre_sign_multipart_upload"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StorageConfig: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StorageConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StorageConfig: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StorageConfig from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StorageConfig.parse_obj(obj) + return cls.model_validate(obj) - _obj = StorageConfig.parse_obj({ + _obj = cls.model_validate({ "blockstore_type": obj.get("blockstore_type"), "blockstore_namespace_example": obj.get("blockstore_namespace_example"), - "blockstore_namespace_validity_regex": obj.get("blockstore_namespace_ValidityRegex"), + "blockstore_namespace_ValidityRegex": obj.get("blockstore_namespace_ValidityRegex"), "default_namespace_prefix": obj.get("default_namespace_prefix"), "pre_sign_support": obj.get("pre_sign_support"), "pre_sign_support_ui": obj.get("pre_sign_support_ui"), diff --git a/clients/python/lakefs_sdk/models/storage_uri.py b/clients/python/lakefs_sdk/models/storage_uri.py index 96ba09be50b..2f2fa718312 100644 --- a/clients/python/lakefs_sdk/models/storage_uri.py +++ b/clients/python/lakefs_sdk/models/storage_uri.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class StorageURI(BaseModel): """ URI to a path in a storage provider (e.g. \"s3://bucket1/path/to/object\") - """ - location: StrictStr = Field(...) - __properties = ["location"] + """ # noqa: E501 + location: StrictStr + __properties: ClassVar[List[str]] = ["location"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StorageURI: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StorageURI from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StorageURI: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StorageURI from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StorageURI.parse_obj(obj) + return cls.model_validate(obj) - _obj = StorageURI.parse_obj({ + _obj = cls.model_validate({ "location": obj.get("location") }) return _obj diff --git a/clients/python/lakefs_sdk/models/sts_auth_request.py b/clients/python/lakefs_sdk/models/sts_auth_request.py index 3fe5e242488..835917f915d 100644 --- a/clients/python/lakefs_sdk/models/sts_auth_request.py +++ b/clients/python/lakefs_sdk/models/sts_auth_request.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StsAuthRequest(BaseModel): """ StsAuthRequest - """ - code: StrictStr = Field(...) - state: StrictStr = Field(...) - redirect_uri: StrictStr = Field(...) - ttl_seconds: Optional[StrictInt] = Field(None, description="The time-to-live for the generated token in seconds. The default value is 3600 seconds (1 hour) maximum time allowed is 12 hours. ") - __properties = ["code", "state", "redirect_uri", "ttl_seconds"] + """ # noqa: E501 + code: StrictStr + state: StrictStr + redirect_uri: StrictStr + ttl_seconds: Optional[StrictInt] = Field(default=None, description="The time-to-live for the generated token in seconds. The default value is 3600 seconds (1 hour) maximum time allowed is 12 hours. ") + __properties: ClassVar[List[str]] = ["code", "state", "redirect_uri", "ttl_seconds"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StsAuthRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StsAuthRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StsAuthRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StsAuthRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StsAuthRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = StsAuthRequest.parse_obj({ + _obj = cls.model_validate({ "code": obj.get("code"), "state": obj.get("state"), "redirect_uri": obj.get("redirect_uri"), diff --git a/clients/python/lakefs_sdk/models/tag_creation.py b/clients/python/lakefs_sdk/models/tag_creation.py index 394a54c944c..93368c6b9aa 100644 --- a/clients/python/lakefs_sdk/models/tag_creation.py +++ b/clients/python/lakefs_sdk/models/tag_creation.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class TagCreation(BaseModel): """ Make tag ID point at this REF. - """ - id: StrictStr = Field(..., description="ID of tag to create") - ref: StrictStr = Field(..., description="the commit to tag") + """ # noqa: E501 + id: StrictStr = Field(description="ID of tag to create") + ref: StrictStr = Field(description="the commit to tag") force: Optional[StrictBool] = False - __properties = ["id", "ref", "force"] + __properties: ClassVar[List[str]] = ["id", "ref", "force"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> TagCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TagCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> TagCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TagCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TagCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = TagCreation.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "ref": obj.get("ref"), "force": obj.get("force") if obj.get("force") is not None else False diff --git a/clients/python/lakefs_sdk/models/task_info.py b/clients/python/lakefs_sdk/models/task_info.py index caeda8dd206..8b6f85380df 100644 --- a/clients/python/lakefs_sdk/models/task_info.py +++ b/clients/python/lakefs_sdk/models/task_info.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class TaskInfo(BaseModel): """ TaskInfo - """ - id: StrictStr = Field(..., description="ID of the task") - __properties = ["id"] + """ # noqa: E501 + id: StrictStr = Field(description="ID of the task") + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> TaskInfo: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TaskInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> TaskInfo: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TaskInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TaskInfo.parse_obj(obj) + return cls.model_validate(obj) - _obj = TaskInfo.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id") }) return _obj diff --git a/clients/python/lakefs_sdk/models/underlying_object_properties.py b/clients/python/lakefs_sdk/models/underlying_object_properties.py index d93d6831c62..2d35e8bd1de 100644 --- a/clients/python/lakefs_sdk/models/underlying_object_properties.py +++ b/clients/python/lakefs_sdk/models/underlying_object_properties.py @@ -18,61 +18,77 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class UnderlyingObjectProperties(BaseModel): """ UnderlyingObjectProperties - """ + """ # noqa: E501 storage_class: Optional[StrictStr] = None - __properties = ["storage_class"] + __properties: ClassVar[List[str]] = ["storage_class"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UnderlyingObjectProperties: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UnderlyingObjectProperties from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if storage_class (nullable) is None - # and __fields_set__ contains the field - if self.storage_class is None and "storage_class" in self.__fields_set__: + # and model_fields_set contains the field + if self.storage_class is None and "storage_class" in self.model_fields_set: _dict['storage_class'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UnderlyingObjectProperties: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UnderlyingObjectProperties from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UnderlyingObjectProperties.parse_obj(obj) + return cls.model_validate(obj) - _obj = UnderlyingObjectProperties.parse_obj({ + _obj = cls.model_validate({ "storage_class": obj.get("storage_class") }) return _obj diff --git a/clients/python/lakefs_sdk/models/update_token.py b/clients/python/lakefs_sdk/models/update_token.py index 8f6f223e38c..9a2275ceb80 100644 --- a/clients/python/lakefs_sdk/models/update_token.py +++ b/clients/python/lakefs_sdk/models/update_token.py @@ -18,56 +18,72 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictStr + from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UpdateToken(BaseModel): """ UpdateToken - """ - staging_token: StrictStr = Field(...) - __properties = ["staging_token"] + """ # noqa: E501 + staging_token: StrictStr + __properties: ClassVar[List[str]] = ["staging_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UpdateToken: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UpdateToken from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> UpdateToken: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UpdateToken from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UpdateToken.parse_obj(obj) + return cls.model_validate(obj) - _obj = UpdateToken.parse_obj({ + _obj = cls.model_validate({ "staging_token": obj.get("staging_token") }) return _obj diff --git a/clients/python/lakefs_sdk/models/upload_part.py b/clients/python/lakefs_sdk/models/upload_part.py index 31d3a2e42b2..771f2696dad 100644 --- a/clients/python/lakefs_sdk/models/upload_part.py +++ b/clients/python/lakefs_sdk/models/upload_part.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UploadPart(BaseModel): """ UploadPart - """ - part_number: StrictInt = Field(...) - etag: StrictStr = Field(...) - __properties = ["part_number", "etag"] + """ # noqa: E501 + part_number: StrictInt + etag: StrictStr + __properties: ClassVar[List[str]] = ["part_number", "etag"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UploadPart: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UploadPart from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> UploadPart: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UploadPart from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UploadPart.parse_obj(obj) + return cls.model_validate(obj) - _obj = UploadPart.parse_obj({ + _obj = cls.model_validate({ "part_number": obj.get("part_number"), "etag": obj.get("etag") }) diff --git a/clients/python/lakefs_sdk/models/usage_report.py b/clients/python/lakefs_sdk/models/usage_report.py index 158ee86da7b..85ae4dfacb6 100644 --- a/clients/python/lakefs_sdk/models/usage_report.py +++ b/clients/python/lakefs_sdk/models/usage_report.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - try: - from pydantic.v1 import BaseModel, Field, StrictInt + from pydantic.v1 import BaseModel, ConfigDict, StrictInt except ImportError: - from pydantic import BaseModel, Field, StrictInt + from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class UsageReport(BaseModel): """ UsageReport - """ - year: StrictInt = Field(...) - month: StrictInt = Field(...) - count: StrictInt = Field(...) - __properties = ["year", "month", "count"] + """ # noqa: E501 + year: StrictInt + month: StrictInt + count: StrictInt + __properties: ClassVar[List[str]] = ["year", "month", "count"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UsageReport: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UsageReport from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> UsageReport: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UsageReport from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UsageReport.parse_obj(obj) + return cls.model_validate(obj) - _obj = UsageReport.parse_obj({ + _obj = cls.model_validate({ "year": obj.get("year"), "month": obj.get("month"), "count": obj.get("count") diff --git a/clients/python/lakefs_sdk/models/user.py b/clients/python/lakefs_sdk/models/user.py index 5b8a635a3fe..9e5e3e50d45 100644 --- a/clients/python/lakefs_sdk/models/user.py +++ b/clients/python/lakefs_sdk/models/user.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictInt, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class User(BaseModel): """ User - """ - id: StrictStr = Field(..., description="A unique identifier for the user. Cannot be edited.") - creation_date: StrictInt = Field(..., description="Unix Epoch in seconds") - friendly_name: Optional[StrictStr] = Field(None, description="A shorter name for the user than the id. Unlike id it does not identify the user (it might not be unique). Used in some places in the UI. ") - email: Optional[StrictStr] = Field(None, description="The email address of the user. If API authentication is enabled, this field is mandatory and will be invited to login. If API authentication is disabled, this field will be ignored. All current APIAuthenticators require the email to be lowercase and unique, although custom authenticators may not enforce this. ") - __properties = ["id", "creation_date", "friendly_name", "email"] + """ # noqa: E501 + id: StrictStr = Field(description="A unique identifier for the user. Cannot be edited.") + creation_date: StrictInt = Field(description="Unix Epoch in seconds") + friendly_name: Optional[StrictStr] = Field(default=None, description="A shorter name for the user than the id. Unlike id it does not identify the user (it might not be unique). Used in some places in the UI. ") + email: Optional[StrictStr] = Field(default=None, description="The email address of the user. If API authentication is enabled, this field is mandatory and will be invited to login. If API authentication is disabled, this field will be ignored. All current APIAuthenticators require the email to be lowercase and unique, although custom authenticators may not enforce this. ") + __properties: ClassVar[List[str]] = ["id", "creation_date", "friendly_name", "email"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> User: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of User from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> User: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of User from a dict""" if obj is None: return None if not isinstance(obj, dict): - return User.parse_obj(obj) + return cls.model_validate(obj) - _obj = User.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "creation_date": obj.get("creation_date"), "friendly_name": obj.get("friendly_name"), diff --git a/clients/python/lakefs_sdk/models/user_creation.py b/clients/python/lakefs_sdk/models/user_creation.py index 9613e3a2311..1ca3cc43855 100644 --- a/clients/python/lakefs_sdk/models/user_creation.py +++ b/clients/python/lakefs_sdk/models/user_creation.py @@ -18,57 +18,73 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, Field, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, Field, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, Field, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class UserCreation(BaseModel): """ UserCreation - """ - id: StrictStr = Field(..., description="a unique identifier for the user.") + """ # noqa: E501 + id: StrictStr = Field(description="a unique identifier for the user.") invite_user: Optional[StrictBool] = None - __properties = ["id", "invite_user"] + __properties: ClassVar[List[str]] = ["id", "invite_user"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserCreation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserCreation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> UserCreation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserCreation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserCreation.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserCreation.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "invite_user": obj.get("invite_user") }) diff --git a/clients/python/lakefs_sdk/models/user_list.py b/clients/python/lakefs_sdk/models/user_list.py index 587ce74150b..470e665ffc6 100644 --- a/clients/python/lakefs_sdk/models/user_list.py +++ b/clients/python/lakefs_sdk/models/user_list.py @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import List try: - from pydantic.v1 import BaseModel, Field, conlist + from pydantic.v1 import BaseModel, ConfigDict except ImportError: - from pydantic import BaseModel, Field, conlist + from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from lakefs_sdk.models.pagination import Pagination from lakefs_sdk.models.user import User +from typing import Optional, Set +from typing_extensions import Self class UserList(BaseModel): """ UserList - """ - pagination: Pagination = Field(...) - results: conlist(User) = Field(...) - __properties = ["pagination", "results"] + """ # noqa: E501 + pagination: Pagination + results: List[User] + __properties: ClassVar[List[str]] = ["pagination", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> UserList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserList.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserList.parse_obj({ - "pagination": Pagination.from_dict(obj.get("pagination")) if obj.get("pagination") is not None else None, - "results": [User.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "results": [User.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/clients/python/lakefs_sdk/models/version_config.py b/clients/python/lakefs_sdk/models/version_config.py index 9b36e5dc8de..39e843b63b1 100644 --- a/clients/python/lakefs_sdk/models/version_config.py +++ b/clients/python/lakefs_sdk/models/version_config.py @@ -18,59 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional try: - from pydantic.v1 import BaseModel, StrictBool, StrictStr + from pydantic.v1 import BaseModel, ConfigDict, StrictBool, StrictStr except ImportError: - from pydantic import BaseModel, StrictBool, StrictStr + from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class VersionConfig(BaseModel): """ VersionConfig - """ + """ # noqa: E501 version: Optional[StrictStr] = None latest_version: Optional[StrictStr] = None upgrade_recommended: Optional[StrictBool] = None upgrade_url: Optional[StrictStr] = None - __properties = ["version", "latest_version", "upgrade_recommended", "upgrade_url"] + __properties: ClassVar[List[str]] = ["version", "latest_version", "upgrade_recommended", "upgrade_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> VersionConfig: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of VersionConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> VersionConfig: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of VersionConfig from a dict""" if obj is None: return None if not isinstance(obj, dict): - return VersionConfig.parse_obj(obj) + return cls.model_validate(obj) - _obj = VersionConfig.parse_obj({ + _obj = cls.model_validate({ "version": obj.get("version"), "latest_version": obj.get("latest_version"), "upgrade_recommended": obj.get("upgrade_recommended"), diff --git a/clients/python/lakefs_sdk/rest.py b/clients/python/lakefs_sdk/rest.py index 68339e181d3..a3733f330fb 100644 --- a/clients/python/lakefs_sdk/rest.py +++ b/clients/python/lakefs_sdk/rest.py @@ -15,43 +15,55 @@ import io import json -import logging import re import ssl -from urllib.parse import urlencode, quote_plus import urllib3 -from lakefs_sdk.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError, BadRequestException +from lakefs_sdk.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -60,74 +72,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -136,63 +153,86 @@ def request(self, method, url, query_params=None, headers=None, post_params = post_params or {} headers = headers or {} - # url already contains the URL query string - # so reset query_params to empty dict - query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int,float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: # no content type provided or payload is json - if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE): + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -203,102 +243,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields={}, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 400: - raise BadRequestException(http_resp=r) - - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def get_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def head_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def options_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def delete_request(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def post_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def put_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def patch_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return RESTResponse(r) diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml index 628f24c9584..b6c21e683a5 100644 --- a/clients/python/pyproject.toml +++ b/clients/python/pyproject.toml @@ -14,13 +14,16 @@ python = "^3.7" urllib3 = ">= 1.25.3" python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" -aenum = ">=3.1.11" +pydantic = ">=2" +typing-extensions = ">=4.7.1" [tool.poetry.dev-dependencies] pytest = ">=7.2.1" tox = ">=3.9.0" flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + [build-system] requires = ["setuptools"] @@ -28,3 +31,41 @@ build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "lakefs_sdk", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/clients/python/test-requirements.txt b/clients/python/test-requirements.txt index 3a0d0b939a1..8e6d8cb1374 100644 --- a/clients/python/test-requirements.txt +++ b/clients/python/test-requirements.txt @@ -1,3 +1,5 @@ pytest~=7.1.3 pytest-cov>=2.8.1 pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 diff --git a/clients/python/test/test_abort_presign_multipart_upload.py b/clients/python/test/test_abort_presign_multipart_upload.py index 407d08ec92e..01171a25813 100644 --- a/clients/python/test/test_abort_presign_multipart_upload.py +++ b/clients/python/test/test_abort_presign_multipart_upload.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.abort_presign_multipart_upload import AbortPresignMultipartUpload # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.abort_presign_multipart_upload import AbortPresignMultipartUpload class TestAbortPresignMultipartUpload(unittest.TestCase): """AbortPresignMultipartUpload unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> AbortPresignMultipartUpload: """Test AbortPresignMultipartUpload - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `AbortPresignMultipartUpload` """ - model = lakefs_sdk.models.abort_presign_multipart_upload.AbortPresignMultipartUpload() # noqa: E501 - if include_optional : + model = AbortPresignMultipartUpload() + if include_optional: return AbortPresignMultipartUpload( physical_address = '' ) - else : + else: return AbortPresignMultipartUpload( physical_address = '', ) diff --git a/clients/python/test/test_access_key_credentials.py b/clients/python/test/test_access_key_credentials.py index f8b1808a6ce..f916b50d53e 100644 --- a/clients/python/test/test_access_key_credentials.py +++ b/clients/python/test/test_access_key_credentials.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.access_key_credentials import AccessKeyCredentials # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.access_key_credentials import AccessKeyCredentials class TestAccessKeyCredentials(unittest.TestCase): """AccessKeyCredentials unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> AccessKeyCredentials: """Test AccessKeyCredentials - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `AccessKeyCredentials` """ - model = lakefs_sdk.models.access_key_credentials.AccessKeyCredentials() # noqa: E501 - if include_optional : + model = AccessKeyCredentials() + if include_optional: return AccessKeyCredentials( - access_key_id = 'AKIAIOSFODNN7EXAMPLE', + access_key_id = 'AKIAIOSFODNN7EXAMPLE', secret_access_key = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' ) - else : + else: return AccessKeyCredentials( access_key_id = 'AKIAIOSFODNN7EXAMPLE', secret_access_key = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', diff --git a/clients/python/test/test_acl.py b/clients/python/test/test_acl.py index aea45e0907f..b2731c00317 100644 --- a/clients/python/test/test_acl.py +++ b/clients/python/test/test_acl.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.acl import ACL # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.acl import ACL class TestACL(unittest.TestCase): """ACL unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ACL: """Test ACL - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ACL` """ - model = lakefs_sdk.models.acl.ACL() # noqa: E501 - if include_optional : + model = ACL() + if include_optional: return ACL( permission = '' ) - else : + else: return ACL( permission = '', ) diff --git a/clients/python/test/test_action_run.py b/clients/python/test/test_action_run.py index 6a4fc60dd94..f2dc6733426 100644 --- a/clients/python/test/test_action_run.py +++ b/clients/python/test/test_action_run.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.action_run import ActionRun # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.action_run import ActionRun class TestActionRun(unittest.TestCase): """ActionRun unit test stubs""" @@ -29,25 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ActionRun: """Test ActionRun - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ActionRun` """ - model = lakefs_sdk.models.action_run.ActionRun() # noqa: E501 - if include_optional : + model = ActionRun() + if include_optional: return ActionRun( - run_id = '', - branch = '', - start_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - end_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - event_type = '', - status = 'failed', + run_id = '', + branch = '', + start_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + end_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + event_type = '', + status = 'failed', commit_id = '' ) - else : + else: return ActionRun( run_id = '', branch = '', diff --git a/clients/python/test/test_action_run_list.py b/clients/python/test/test_action_run_list.py index fba60606448..2b9e510e001 100644 --- a/clients/python/test/test_action_run_list.py +++ b/clients/python/test/test_action_run_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.action_run_list import ActionRunList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.action_run_list import ActionRunList class TestActionRunList(unittest.TestCase): """ActionRunList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ActionRunList: """Test ActionRunList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ActionRunList` """ - model = lakefs_sdk.models.action_run_list.ActionRunList() # noqa: E501 - if include_optional : + model = ActionRunList() + if include_optional: return ActionRunList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.action_run.ActionRun( run_id = '', @@ -55,7 +52,7 @@ def make_instance(self, include_optional): commit_id = '', ) ] ) - else : + else: return ActionRunList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_actions_api.py b/clients/python/test/test_actions_api.py index 738ad344158..221a3f25d2f 100644 --- a/clients/python/test/test_actions_api.py +++ b/clients/python/test/test_actions_api.py @@ -15,45 +15,43 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.actions_api import ActionsApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.actions_api import ActionsApi class TestActionsApi(unittest.TestCase): """ActionsApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.actions_api.ActionsApi() # noqa: E501 + def setUp(self) -> None: + self.api = ActionsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_run(self): + def test_get_run(self) -> None: """Test case for get_run - get a run # noqa: E501 + get a run """ pass - def test_get_run_hook_output(self): + def test_get_run_hook_output(self) -> None: """Test case for get_run_hook_output - get run hook output # noqa: E501 + get run hook output """ pass - def test_list_repository_runs(self): + def test_list_repository_runs(self) -> None: """Test case for list_repository_runs - list runs # noqa: E501 + list runs """ pass - def test_list_run_hooks(self): + def test_list_run_hooks(self) -> None: """Test case for list_run_hooks - list run hooks # noqa: E501 + list run hooks """ pass diff --git a/clients/python/test/test_auth_api.py b/clients/python/test/test_auth_api.py index 96dfe3671c5..e7fb9afa96f 100644 --- a/clients/python/test/test_auth_api.py +++ b/clients/python/test/test_auth_api.py @@ -15,269 +15,267 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.auth_api import AuthApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.auth_api import AuthApi class TestAuthApi(unittest.TestCase): """AuthApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.auth_api.AuthApi() # noqa: E501 + def setUp(self) -> None: + self.api = AuthApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_group_membership(self): + def test_add_group_membership(self) -> None: """Test case for add_group_membership - add group membership # noqa: E501 + add group membership """ pass - def test_attach_policy_to_group(self): + def test_attach_policy_to_group(self) -> None: """Test case for attach_policy_to_group - attach policy to group # noqa: E501 + attach policy to group """ pass - def test_attach_policy_to_user(self): + def test_attach_policy_to_user(self) -> None: """Test case for attach_policy_to_user - attach policy to user # noqa: E501 + attach policy to user """ pass - def test_create_credentials(self): + def test_create_credentials(self) -> None: """Test case for create_credentials - create credentials # noqa: E501 + create credentials """ pass - def test_create_group(self): + def test_create_group(self) -> None: """Test case for create_group - create group # noqa: E501 + create group """ pass - def test_create_policy(self): + def test_create_policy(self) -> None: """Test case for create_policy - create policy # noqa: E501 + create policy """ pass - def test_create_user(self): + def test_create_user(self) -> None: """Test case for create_user - create user # noqa: E501 + create user """ pass - def test_create_user_external_principal(self): + def test_create_user_external_principal(self) -> None: """Test case for create_user_external_principal - attach external principal to user # noqa: E501 + attach external principal to user """ pass - def test_delete_credentials(self): + def test_delete_credentials(self) -> None: """Test case for delete_credentials - delete credentials # noqa: E501 + delete credentials """ pass - def test_delete_group(self): + def test_delete_group(self) -> None: """Test case for delete_group - delete group # noqa: E501 + delete group """ pass - def test_delete_group_membership(self): + def test_delete_group_membership(self) -> None: """Test case for delete_group_membership - delete group membership # noqa: E501 + delete group membership """ pass - def test_delete_policy(self): + def test_delete_policy(self) -> None: """Test case for delete_policy - delete policy # noqa: E501 + delete policy """ pass - def test_delete_user(self): + def test_delete_user(self) -> None: """Test case for delete_user - delete user # noqa: E501 + delete user """ pass - def test_delete_user_external_principal(self): + def test_delete_user_external_principal(self) -> None: """Test case for delete_user_external_principal - delete external principal from user # noqa: E501 + delete external principal from user """ pass - def test_detach_policy_from_group(self): + def test_detach_policy_from_group(self) -> None: """Test case for detach_policy_from_group - detach policy from group # noqa: E501 + detach policy from group """ pass - def test_detach_policy_from_user(self): + def test_detach_policy_from_user(self) -> None: """Test case for detach_policy_from_user - detach policy from user # noqa: E501 + detach policy from user """ pass - def test_external_principal_login(self): + def test_external_principal_login(self) -> None: """Test case for external_principal_login - perform a login using an external authenticator # noqa: E501 + perform a login using an external authenticator """ pass - def test_get_credentials(self): + def test_get_credentials(self) -> None: """Test case for get_credentials - get credentials # noqa: E501 + get credentials """ pass - def test_get_current_user(self): + def test_get_current_user(self) -> None: """Test case for get_current_user - get current user # noqa: E501 + get current user """ pass - def test_get_external_principal(self): + def test_get_external_principal(self) -> None: """Test case for get_external_principal - describe external principal by id # noqa: E501 + describe external principal by id """ pass - def test_get_group(self): + def test_get_group(self) -> None: """Test case for get_group - get group # noqa: E501 + get group """ pass - def test_get_group_acl(self): + def test_get_group_acl(self) -> None: """Test case for get_group_acl - get ACL of group # noqa: E501 + get ACL of group """ pass - def test_get_policy(self): + def test_get_policy(self) -> None: """Test case for get_policy - get policy # noqa: E501 + get policy """ pass - def test_get_user(self): + def test_get_user(self) -> None: """Test case for get_user - get user # noqa: E501 + get user """ pass - def test_list_group_members(self): + def test_list_group_members(self) -> None: """Test case for list_group_members - list group members # noqa: E501 + list group members """ pass - def test_list_group_policies(self): + def test_list_group_policies(self) -> None: """Test case for list_group_policies - list group policies # noqa: E501 + list group policies """ pass - def test_list_groups(self): + def test_list_groups(self) -> None: """Test case for list_groups - list groups # noqa: E501 + list groups """ pass - def test_list_policies(self): + def test_list_policies(self) -> None: """Test case for list_policies - list policies # noqa: E501 + list policies """ pass - def test_list_user_credentials(self): + def test_list_user_credentials(self) -> None: """Test case for list_user_credentials - list user credentials # noqa: E501 + list user credentials """ pass - def test_list_user_external_principals(self): + def test_list_user_external_principals(self) -> None: """Test case for list_user_external_principals - list user external policies attached to a user # noqa: E501 + list user external policies attached to a user """ pass - def test_list_user_groups(self): + def test_list_user_groups(self) -> None: """Test case for list_user_groups - list user groups # noqa: E501 + list user groups """ pass - def test_list_user_policies(self): + def test_list_user_policies(self) -> None: """Test case for list_user_policies - list user policies # noqa: E501 + list user policies """ pass - def test_list_users(self): + def test_list_users(self) -> None: """Test case for list_users - list users # noqa: E501 + list users """ pass - def test_login(self): + def test_login(self) -> None: """Test case for login - perform a login # noqa: E501 + perform a login """ pass - def test_set_group_acl(self): + def test_set_group_acl(self) -> None: """Test case for set_group_acl - set ACL of group # noqa: E501 + set ACL of group """ pass - def test_update_policy(self): + def test_update_policy(self) -> None: """Test case for update_policy - update policy # noqa: E501 + update policy """ pass diff --git a/clients/python/test/test_auth_capabilities.py b/clients/python/test/test_auth_capabilities.py index fd3cd85e3a6..9dec88c2db4 100644 --- a/clients/python/test/test_auth_capabilities.py +++ b/clients/python/test/test_auth_capabilities.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.auth_capabilities import AuthCapabilities # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.auth_capabilities import AuthCapabilities class TestAuthCapabilities(unittest.TestCase): """AuthCapabilities unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> AuthCapabilities: """Test AuthCapabilities - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `AuthCapabilities` """ - model = lakefs_sdk.models.auth_capabilities.AuthCapabilities() # noqa: E501 - if include_optional : + model = AuthCapabilities() + if include_optional: return AuthCapabilities( - invite_user = True, + invite_user = True, forgot_password = True ) - else : + else: return AuthCapabilities( ) """ diff --git a/clients/python/test/test_authentication_token.py b/clients/python/test/test_authentication_token.py index bfc2c017f65..906fa3a7060 100644 --- a/clients/python/test/test_authentication_token.py +++ b/clients/python/test/test_authentication_token.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.authentication_token import AuthenticationToken # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.authentication_token import AuthenticationToken class TestAuthenticationToken(unittest.TestCase): """AuthenticationToken unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> AuthenticationToken: """Test AuthenticationToken - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `AuthenticationToken` """ - model = lakefs_sdk.models.authentication_token.AuthenticationToken() # noqa: E501 - if include_optional : + model = AuthenticationToken() + if include_optional: return AuthenticationToken( - token = '', + token = '', token_expiration = 56 ) - else : + else: return AuthenticationToken( token = '', ) diff --git a/clients/python/test/test_branch_creation.py b/clients/python/test/test_branch_creation.py index 6d5842f8876..7eb8e569cde 100644 --- a/clients/python/test/test_branch_creation.py +++ b/clients/python/test/test_branch_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.branch_creation import BranchCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.branch_creation import BranchCreation class TestBranchCreation(unittest.TestCase): """BranchCreation unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> BranchCreation: """Test BranchCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `BranchCreation` """ - model = lakefs_sdk.models.branch_creation.BranchCreation() # noqa: E501 - if include_optional : + model = BranchCreation() + if include_optional: return BranchCreation( - name = '', - source = '', + name = '', + source = '', force = True ) - else : + else: return BranchCreation( name = '', source = '', diff --git a/clients/python/test/test_branch_protection_rule.py b/clients/python/test/test_branch_protection_rule.py index 8f8efa6f15b..3aebf30797e 100644 --- a/clients/python/test/test_branch_protection_rule.py +++ b/clients/python/test/test_branch_protection_rule.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule class TestBranchProtectionRule(unittest.TestCase): """BranchProtectionRule unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> BranchProtectionRule: """Test BranchProtectionRule - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `BranchProtectionRule` """ - model = lakefs_sdk.models.branch_protection_rule.BranchProtectionRule() # noqa: E501 - if include_optional : + model = BranchProtectionRule() + if include_optional: return BranchProtectionRule( pattern = 'stable_*' ) - else : + else: return BranchProtectionRule( pattern = 'stable_*', ) diff --git a/clients/python/test/test_branches_api.py b/clients/python/test/test_branches_api.py index fa36c15aebc..585d50b9c2b 100644 --- a/clients/python/test/test_branches_api.py +++ b/clients/python/test/test_branches_api.py @@ -15,73 +15,71 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.branches_api import BranchesApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.branches_api import BranchesApi class TestBranchesApi(unittest.TestCase): """BranchesApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.branches_api.BranchesApi() # noqa: E501 + def setUp(self) -> None: + self.api = BranchesApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_cherry_pick(self): + def test_cherry_pick(self) -> None: """Test case for cherry_pick - Replay the changes from the given commit on the branch # noqa: E501 + Replay the changes from the given commit on the branch """ pass - def test_create_branch(self): + def test_create_branch(self) -> None: """Test case for create_branch - create branch # noqa: E501 + create branch """ pass - def test_delete_branch(self): + def test_delete_branch(self) -> None: """Test case for delete_branch - delete branch # noqa: E501 + delete branch """ pass - def test_diff_branch(self): + def test_diff_branch(self) -> None: """Test case for diff_branch - diff branch # noqa: E501 + diff branch """ pass - def test_get_branch(self): + def test_get_branch(self) -> None: """Test case for get_branch - get branch # noqa: E501 + get branch """ pass - def test_list_branches(self): + def test_list_branches(self) -> None: """Test case for list_branches - list branches # noqa: E501 + list branches """ pass - def test_reset_branch(self): + def test_reset_branch(self) -> None: """Test case for reset_branch - reset branch # noqa: E501 + reset branch """ pass - def test_revert_branch(self): + def test_revert_branch(self) -> None: """Test case for revert_branch - revert # noqa: E501 + revert """ pass diff --git a/clients/python/test/test_cherry_pick_creation.py b/clients/python/test/test_cherry_pick_creation.py index 7733510c5b4..a6977260889 100644 --- a/clients/python/test/test_cherry_pick_creation.py +++ b/clients/python/test/test_cherry_pick_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.cherry_pick_creation import CherryPickCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.cherry_pick_creation import CherryPickCreation class TestCherryPickCreation(unittest.TestCase): """CherryPickCreation unit test stubs""" @@ -29,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CherryPickCreation: """Test CherryPickCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CherryPickCreation` """ - model = lakefs_sdk.models.cherry_pick_creation.CherryPickCreation() # noqa: E501 - if include_optional : + model = CherryPickCreation() + if include_optional: return CherryPickCreation( - ref = '', - parent_number = 56, + ref = '', + parent_number = 56, commit_overrides = lakefs_sdk.models.commit_overrides.CommitOverrides( message = '', metadata = { 'key' : '' - }, ), + }, ), force = True ) - else : + else: return CherryPickCreation( ref = '', ) diff --git a/clients/python/test/test_comm_prefs_input.py b/clients/python/test/test_comm_prefs_input.py index 38fdffbe137..a2cc140ad70 100644 --- a/clients/python/test/test_comm_prefs_input.py +++ b/clients/python/test/test_comm_prefs_input.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.comm_prefs_input import CommPrefsInput # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.comm_prefs_input import CommPrefsInput class TestCommPrefsInput(unittest.TestCase): """CommPrefsInput unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CommPrefsInput: """Test CommPrefsInput - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CommPrefsInput` """ - model = lakefs_sdk.models.comm_prefs_input.CommPrefsInput() # noqa: E501 - if include_optional : + model = CommPrefsInput() + if include_optional: return CommPrefsInput( - email = '', - feature_updates = True, + email = '', + feature_updates = True, security_updates = True ) - else : + else: return CommPrefsInput( feature_updates = True, security_updates = True, diff --git a/clients/python/test/test_commit.py b/clients/python/test/test_commit.py index 7c588fc804e..35ec418dd8c 100644 --- a/clients/python/test/test_commit.py +++ b/clients/python/test/test_commit.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.commit import Commit # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.commit import Commit class TestCommit(unittest.TestCase): """Commit unit test stubs""" @@ -29,31 +26,31 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Commit: """Test Commit - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Commit` """ - model = lakefs_sdk.models.commit.Commit() # noqa: E501 - if include_optional : + model = Commit() + if include_optional: return Commit( - id = '', + id = '', parents = [ '' - ], - committer = '', - message = '', - creation_date = 56, - meta_range_id = '', + ], + committer = '', + message = '', + creation_date = 56, + meta_range_id = '', metadata = { 'key' : '' - }, - generation = 56, + }, + generation = 56, version = 0 ) - else : + else: return Commit( id = '', parents = [ diff --git a/clients/python/test/test_commit_creation.py b/clients/python/test/test_commit_creation.py index 512383c21f9..dbdfdee7673 100644 --- a/clients/python/test/test_commit_creation.py +++ b/clients/python/test/test_commit_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.commit_creation import CommitCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.commit_creation import CommitCreation class TestCommitCreation(unittest.TestCase): """CommitCreation unit test stubs""" @@ -29,25 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CommitCreation: """Test CommitCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CommitCreation` """ - model = lakefs_sdk.models.commit_creation.CommitCreation() # noqa: E501 - if include_optional : + model = CommitCreation() + if include_optional: return CommitCreation( - message = '', + message = '', metadata = { 'key' : '' - }, - var_date = 56, - allow_empty = True, + }, + var_date = 56, + allow_empty = True, force = True ) - else : + else: return CommitCreation( message = '', ) diff --git a/clients/python/test/test_commit_list.py b/clients/python/test/test_commit_list.py index ffa68ce27ce..ffd43aa2fd8 100644 --- a/clients/python/test/test_commit_list.py +++ b/clients/python/test/test_commit_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.commit_list import CommitList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.commit_list import CommitList class TestCommitList(unittest.TestCase): """CommitList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CommitList: """Test CommitList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CommitList` """ - model = lakefs_sdk.models.commit_list.CommitList() # noqa: E501 - if include_optional : + model = CommitList() + if include_optional: return CommitList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.commit.Commit( id = '', @@ -61,7 +58,7 @@ def make_instance(self, include_optional): version = 0, ) ] ) - else : + else: return CommitList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_commit_overrides.py b/clients/python/test/test_commit_overrides.py index 050ecdf0416..e2e797a9e52 100644 --- a/clients/python/test/test_commit_overrides.py +++ b/clients/python/test/test_commit_overrides.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.commit_overrides import CommitOverrides # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.commit_overrides import CommitOverrides class TestCommitOverrides(unittest.TestCase): """CommitOverrides unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CommitOverrides: """Test CommitOverrides - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CommitOverrides` """ - model = lakefs_sdk.models.commit_overrides.CommitOverrides() # noqa: E501 - if include_optional : + model = CommitOverrides() + if include_optional: return CommitOverrides( - message = '', + message = '', metadata = { 'key' : '' } ) - else : + else: return CommitOverrides( ) """ diff --git a/clients/python/test/test_commit_record_creation.py b/clients/python/test/test_commit_record_creation.py index 13de4ea5b7b..ceaee0e129b 100644 --- a/clients/python/test/test_commit_record_creation.py +++ b/clients/python/test/test_commit_record_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.commit_record_creation import CommitRecordCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.commit_record_creation import CommitRecordCreation class TestCommitRecordCreation(unittest.TestCase): """CommitRecordCreation unit test stubs""" @@ -29,32 +26,32 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CommitRecordCreation: """Test CommitRecordCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CommitRecordCreation` """ - model = lakefs_sdk.models.commit_record_creation.CommitRecordCreation() # noqa: E501 - if include_optional : + model = CommitRecordCreation() + if include_optional: return CommitRecordCreation( - commit_id = '', - version = 0, - committer = '', - message = '', - metarange_id = '', - creation_date = 56, + commit_id = '', + version = 0, + committer = '', + message = '', + metarange_id = '', + creation_date = 56, parents = [ '' - ], + ], metadata = { 'key' : '' - }, - generation = 56, + }, + generation = 56, force = True ) - else : + else: return CommitRecordCreation( commit_id = '', version = 0, diff --git a/clients/python/test/test_commits_api.py b/clients/python/test/test_commits_api.py index 2d336273234..29d383c5073 100644 --- a/clients/python/test/test_commits_api.py +++ b/clients/python/test/test_commits_api.py @@ -15,31 +15,29 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.commits_api import CommitsApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.commits_api import CommitsApi class TestCommitsApi(unittest.TestCase): """CommitsApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.commits_api.CommitsApi() # noqa: E501 + def setUp(self) -> None: + self.api = CommitsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_commit(self): + def test_commit(self) -> None: """Test case for commit - create commit # noqa: E501 + create commit """ pass - def test_get_commit(self): + def test_get_commit(self) -> None: """Test case for get_commit - get commit # noqa: E501 + get commit """ pass diff --git a/clients/python/test/test_complete_presign_multipart_upload.py b/clients/python/test/test_complete_presign_multipart_upload.py index b43416dc8bf..69ba2a8cf3c 100644 --- a/clients/python/test/test_complete_presign_multipart_upload.py +++ b/clients/python/test/test_complete_presign_multipart_upload.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.complete_presign_multipart_upload import CompletePresignMultipartUpload # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.complete_presign_multipart_upload import CompletePresignMultipartUpload class TestCompletePresignMultipartUpload(unittest.TestCase): """CompletePresignMultipartUpload unit test stubs""" @@ -29,28 +26,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CompletePresignMultipartUpload: """Test CompletePresignMultipartUpload - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CompletePresignMultipartUpload` """ - model = lakefs_sdk.models.complete_presign_multipart_upload.CompletePresignMultipartUpload() # noqa: E501 - if include_optional : + model = CompletePresignMultipartUpload() + if include_optional: return CompletePresignMultipartUpload( - physical_address = '', + physical_address = '', parts = [ lakefs_sdk.models.upload_part.UploadPart( part_number = 56, etag = '', ) - ], + ], user_metadata = { 'key' : '' - }, + }, content_type = '' ) - else : + else: return CompletePresignMultipartUpload( physical_address = '', parts = [ diff --git a/clients/python/test/test_config.py b/clients/python/test/test_config.py index 8fb17bdadd6..385ffc915ba 100644 --- a/clients/python/test/test_config.py +++ b/clients/python/test/test_config.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.config import Config # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.config import Config class TestConfig(unittest.TestCase): """Config unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Config: """Test Config - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Config` """ - model = lakefs_sdk.models.config.Config() # noqa: E501 - if include_optional : + model = Config() + if include_optional: return Config( version_config = lakefs_sdk.models.version_config.VersionConfig( version = '', latest_version = '', upgrade_recommended = True, - upgrade_url = '', ), + upgrade_url = '', ), storage_config = lakefs_sdk.models.storage_config.StorageConfig( blockstore_type = '', blockstore_namespace_example = '', @@ -55,7 +52,7 @@ def make_instance(self, include_optional): import_validity_regex = '', pre_sign_multipart_upload = True, ) ) - else : + else: return Config( ) """ diff --git a/clients/python/test/test_config_api.py b/clients/python/test/test_config_api.py index 7b9b539b6e9..0f8eafab406 100644 --- a/clients/python/test/test_config_api.py +++ b/clients/python/test/test_config_api.py @@ -15,21 +15,19 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.config_api import ConfigApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.config_api import ConfigApi class TestConfigApi(unittest.TestCase): """ConfigApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.config_api.ConfigApi() # noqa: E501 + def setUp(self) -> None: + self.api = ConfigApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_config(self): + def test_get_config(self) -> None: """Test case for get_config """ diff --git a/clients/python/test/test_credentials.py b/clients/python/test/test_credentials.py index 71efb1f0640..f190bde6250 100644 --- a/clients/python/test/test_credentials.py +++ b/clients/python/test/test_credentials.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.credentials import Credentials # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.credentials import Credentials class TestCredentials(unittest.TestCase): """Credentials unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Credentials: """Test Credentials - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Credentials` """ - model = lakefs_sdk.models.credentials.Credentials() # noqa: E501 - if include_optional : + model = Credentials() + if include_optional: return Credentials( - access_key_id = '', + access_key_id = '', creation_date = 56 ) - else : + else: return Credentials( access_key_id = '', creation_date = 56, diff --git a/clients/python/test/test_credentials_list.py b/clients/python/test/test_credentials_list.py index 0f1797d4973..883fa0cf57a 100644 --- a/clients/python/test/test_credentials_list.py +++ b/clients/python/test/test_credentials_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.credentials_list import CredentialsList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.credentials_list import CredentialsList class TestCredentialsList(unittest.TestCase): """CredentialsList unit test stubs""" @@ -29,28 +26,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CredentialsList: """Test CredentialsList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CredentialsList` """ - model = lakefs_sdk.models.credentials_list.CredentialsList() # noqa: E501 - if include_optional : + model = CredentialsList() + if include_optional: return CredentialsList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.credentials.Credentials( access_key_id = '', creation_date = 56, ) ] ) - else : + else: return CredentialsList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_credentials_with_secret.py b/clients/python/test/test_credentials_with_secret.py index 5a670726c88..0251cd43024 100644 --- a/clients/python/test/test_credentials_with_secret.py +++ b/clients/python/test/test_credentials_with_secret.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.credentials_with_secret import CredentialsWithSecret # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.credentials_with_secret import CredentialsWithSecret class TestCredentialsWithSecret(unittest.TestCase): """CredentialsWithSecret unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CredentialsWithSecret: """Test CredentialsWithSecret - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CredentialsWithSecret` """ - model = lakefs_sdk.models.credentials_with_secret.CredentialsWithSecret() # noqa: E501 - if include_optional : + model = CredentialsWithSecret() + if include_optional: return CredentialsWithSecret( - access_key_id = '', - secret_access_key = '', + access_key_id = '', + secret_access_key = '', creation_date = 56 ) - else : + else: return CredentialsWithSecret( access_key_id = '', secret_access_key = '', diff --git a/clients/python/test/test_current_user.py b/clients/python/test/test_current_user.py index 439c271f30d..aa49b6247c9 100644 --- a/clients/python/test/test_current_user.py +++ b/clients/python/test/test_current_user.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.current_user import CurrentUser # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.current_user import CurrentUser class TestCurrentUser(unittest.TestCase): """CurrentUser unit test stubs""" @@ -29,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> CurrentUser: """Test CurrentUser - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `CurrentUser` """ - model = lakefs_sdk.models.current_user.CurrentUser() # noqa: E501 - if include_optional : + model = CurrentUser() + if include_optional: return CurrentUser( user = lakefs_sdk.models.user.User( id = '', @@ -45,7 +42,7 @@ def make_instance(self, include_optional): friendly_name = '', email = '', ) ) - else : + else: return CurrentUser( user = lakefs_sdk.models.user.User( id = '', diff --git a/clients/python/test/test_diff.py b/clients/python/test/test_diff.py index 2bb9a61e383..82653293b88 100644 --- a/clients/python/test/test_diff.py +++ b/clients/python/test/test_diff.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.diff import Diff # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.diff import Diff class TestDiff(unittest.TestCase): """Diff unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Diff: """Test Diff - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Diff` """ - model = lakefs_sdk.models.diff.Diff() # noqa: E501 - if include_optional : + model = Diff() + if include_optional: return Diff( - type = 'added', - path = '', - path_type = 'common_prefix', + type = 'added', + path = '', + path_type = 'common_prefix', size_bytes = 56 ) - else : + else: return Diff( type = 'added', path = '', diff --git a/clients/python/test/test_diff_list.py b/clients/python/test/test_diff_list.py index c4d57f5d48a..9210ebca9f1 100644 --- a/clients/python/test/test_diff_list.py +++ b/clients/python/test/test_diff_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.diff_list import DiffList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.diff_list import DiffList class TestDiffList(unittest.TestCase): """DiffList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> DiffList: """Test DiffList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `DiffList` """ - model = lakefs_sdk.models.diff_list.DiffList() # noqa: E501 - if include_optional : + model = DiffList() + if include_optional: return DiffList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.diff.Diff( type = 'added', @@ -52,7 +49,7 @@ def make_instance(self, include_optional): size_bytes = 56, ) ] ) - else : + else: return DiffList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_error.py b/clients/python/test/test_error.py index 634571b1082..7729be03607 100644 --- a/clients/python/test/test_error.py +++ b/clients/python/test/test_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.error import Error # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.error import Error class TestError(unittest.TestCase): """Error unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Error: """Test Error - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Error` """ - model = lakefs_sdk.models.error.Error() # noqa: E501 - if include_optional : + model = Error() + if include_optional: return Error( message = '' ) - else : + else: return Error( message = '', ) diff --git a/clients/python/test/test_error_no_acl.py b/clients/python/test/test_error_no_acl.py index 6745b6f0e48..701743d1663 100644 --- a/clients/python/test/test_error_no_acl.py +++ b/clients/python/test/test_error_no_acl.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.error_no_acl import ErrorNoACL # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.error_no_acl import ErrorNoACL class TestErrorNoACL(unittest.TestCase): """ErrorNoACL unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ErrorNoACL: """Test ErrorNoACL - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ErrorNoACL` """ - model = lakefs_sdk.models.error_no_acl.ErrorNoACL() # noqa: E501 - if include_optional : + model = ErrorNoACL() + if include_optional: return ErrorNoACL( - message = '', + message = '', no_acl = True ) - else : + else: return ErrorNoACL( message = '', ) diff --git a/clients/python/test/test_experimental_api.py b/clients/python/test/test_experimental_api.py index a831f98a15e..413367710dd 100644 --- a/clients/python/test/test_experimental_api.py +++ b/clients/python/test/test_experimental_api.py @@ -15,87 +15,85 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.experimental_api import ExperimentalApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.experimental_api import ExperimentalApi class TestExperimentalApi(unittest.TestCase): """ExperimentalApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.experimental_api.ExperimentalApi() # noqa: E501 + def setUp(self) -> None: + self.api = ExperimentalApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_abort_presign_multipart_upload(self): + def test_abort_presign_multipart_upload(self) -> None: """Test case for abort_presign_multipart_upload - Abort a presign multipart upload # noqa: E501 + Abort a presign multipart upload """ pass - def test_complete_presign_multipart_upload(self): + def test_complete_presign_multipart_upload(self) -> None: """Test case for complete_presign_multipart_upload - Complete a presign multipart upload request # noqa: E501 + Complete a presign multipart upload request """ pass - def test_create_presign_multipart_upload(self): + def test_create_presign_multipart_upload(self) -> None: """Test case for create_presign_multipart_upload - Initiate a multipart upload # noqa: E501 + Initiate a multipart upload """ pass - def test_create_user_external_principal(self): + def test_create_user_external_principal(self) -> None: """Test case for create_user_external_principal - attach external principal to user # noqa: E501 + attach external principal to user """ pass - def test_delete_user_external_principal(self): + def test_delete_user_external_principal(self) -> None: """Test case for delete_user_external_principal - delete external principal from user # noqa: E501 + delete external principal from user """ pass - def test_external_principal_login(self): + def test_external_principal_login(self) -> None: """Test case for external_principal_login - perform a login using an external authenticator # noqa: E501 + perform a login using an external authenticator """ pass - def test_get_external_principal(self): + def test_get_external_principal(self) -> None: """Test case for get_external_principal - describe external principal by id # noqa: E501 + describe external principal by id """ pass - def test_hard_reset_branch(self): + def test_hard_reset_branch(self) -> None: """Test case for hard_reset_branch - hard reset branch # noqa: E501 + hard reset branch """ pass - def test_list_user_external_principals(self): + def test_list_user_external_principals(self) -> None: """Test case for list_user_external_principals - list user external policies attached to a user # noqa: E501 + list user external policies attached to a user """ pass - def test_sts_login(self): + def test_sts_login(self) -> None: """Test case for sts_login - perform a login with STS # noqa: E501 + perform a login with STS """ pass diff --git a/clients/python/test/test_external_api.py b/clients/python/test/test_external_api.py index ba3a4b93e16..03a1904ee1e 100644 --- a/clients/python/test/test_external_api.py +++ b/clients/python/test/test_external_api.py @@ -15,52 +15,50 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.external_api import ExternalApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.external_api import ExternalApi class TestExternalApi(unittest.TestCase): """ExternalApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.external_api.ExternalApi() # noqa: E501 + def setUp(self) -> None: + self.api = ExternalApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_create_user_external_principal(self): + def test_create_user_external_principal(self) -> None: """Test case for create_user_external_principal - attach external principal to user # noqa: E501 + attach external principal to user """ pass - def test_delete_user_external_principal(self): + def test_delete_user_external_principal(self) -> None: """Test case for delete_user_external_principal - delete external principal from user # noqa: E501 + delete external principal from user """ pass - def test_external_principal_login(self): + def test_external_principal_login(self) -> None: """Test case for external_principal_login - perform a login using an external authenticator # noqa: E501 + perform a login using an external authenticator """ pass - def test_get_external_principal(self): + def test_get_external_principal(self) -> None: """Test case for get_external_principal - describe external principal by id # noqa: E501 + describe external principal by id """ pass - def test_list_user_external_principals(self): + def test_list_user_external_principals(self) -> None: """Test case for list_user_external_principals - list user external policies attached to a user # noqa: E501 + list user external policies attached to a user """ pass diff --git a/clients/python/test/test_external_login_information.py b/clients/python/test/test_external_login_information.py index b2cfb95eb4f..2bfe911cc68 100644 --- a/clients/python/test/test_external_login_information.py +++ b/clients/python/test/test_external_login_information.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.external_login_information import ExternalLoginInformation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.external_login_information import ExternalLoginInformation class TestExternalLoginInformation(unittest.TestCase): """ExternalLoginInformation unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ExternalLoginInformation: """Test ExternalLoginInformation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ExternalLoginInformation` """ - model = lakefs_sdk.models.external_login_information.ExternalLoginInformation() # noqa: E501 - if include_optional : + model = ExternalLoginInformation() + if include_optional: return ExternalLoginInformation( - token_expiration_duration = 56, + token_expiration_duration = 56, identity_request = None ) - else : + else: return ExternalLoginInformation( identity_request = None, ) diff --git a/clients/python/test/test_external_principal.py b/clients/python/test/test_external_principal.py index a01aad6c4dc..13761d3dfb9 100644 --- a/clients/python/test/test_external_principal.py +++ b/clients/python/test/test_external_principal.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.external_principal import ExternalPrincipal # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.external_principal import ExternalPrincipal class TestExternalPrincipal(unittest.TestCase): """ExternalPrincipal unit test stubs""" @@ -29,25 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ExternalPrincipal: """Test ExternalPrincipal - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ExternalPrincipal` """ - model = lakefs_sdk.models.external_principal.ExternalPrincipal() # noqa: E501 - if include_optional : + model = ExternalPrincipal() + if include_optional: return ExternalPrincipal( - id = '', - user_id = '', + id = '', + user_id = '', settings = [ { 'key' : '' } ] ) - else : + else: return ExternalPrincipal( id = '', user_id = '', diff --git a/clients/python/test/test_external_principal_creation.py b/clients/python/test/test_external_principal_creation.py index d5a771cc179..48f424ac3bd 100644 --- a/clients/python/test/test_external_principal_creation.py +++ b/clients/python/test/test_external_principal_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.external_principal_creation import ExternalPrincipalCreation class TestExternalPrincipalCreation(unittest.TestCase): """ExternalPrincipalCreation unit test stubs""" @@ -29,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ExternalPrincipalCreation: """Test ExternalPrincipalCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ExternalPrincipalCreation` """ - model = lakefs_sdk.models.external_principal_creation.ExternalPrincipalCreation() # noqa: E501 - if include_optional : + model = ExternalPrincipalCreation() + if include_optional: return ExternalPrincipalCreation( settings = [ { @@ -45,7 +42,7 @@ def make_instance(self, include_optional): } ] ) - else : + else: return ExternalPrincipalCreation( ) """ diff --git a/clients/python/test/test_external_principal_list.py b/clients/python/test/test_external_principal_list.py index 268a37db9a3..3aae2c8ac6e 100644 --- a/clients/python/test/test_external_principal_list.py +++ b/clients/python/test/test_external_principal_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.external_principal_list import ExternalPrincipalList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.external_principal_list import ExternalPrincipalList class TestExternalPrincipalList(unittest.TestCase): """ExternalPrincipalList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ExternalPrincipalList: """Test ExternalPrincipalList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ExternalPrincipalList` """ - model = lakefs_sdk.models.external_principal_list.ExternalPrincipalList() # noqa: E501 - if include_optional : + model = ExternalPrincipalList() + if include_optional: return ExternalPrincipalList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.external_principal.ExternalPrincipal( id = '', @@ -55,7 +52,7 @@ def make_instance(self, include_optional): ], ) ] ) - else : + else: return ExternalPrincipalList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_find_merge_base_result.py b/clients/python/test/test_find_merge_base_result.py index 5d15b377ff9..19905bbe311 100644 --- a/clients/python/test/test_find_merge_base_result.py +++ b/clients/python/test/test_find_merge_base_result.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.find_merge_base_result import FindMergeBaseResult # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.find_merge_base_result import FindMergeBaseResult class TestFindMergeBaseResult(unittest.TestCase): """FindMergeBaseResult unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> FindMergeBaseResult: """Test FindMergeBaseResult - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `FindMergeBaseResult` """ - model = lakefs_sdk.models.find_merge_base_result.FindMergeBaseResult() # noqa: E501 - if include_optional : + model = FindMergeBaseResult() + if include_optional: return FindMergeBaseResult( - source_commit_id = '', - destination_commit_id = '', + source_commit_id = '', + destination_commit_id = '', base_commit_id = '' ) - else : + else: return FindMergeBaseResult( source_commit_id = '', destination_commit_id = '', diff --git a/clients/python/test/test_garbage_collection_config.py b/clients/python/test/test_garbage_collection_config.py index 3e2ea28b1ef..cf6e9d1f814 100644 --- a/clients/python/test/test_garbage_collection_config.py +++ b/clients/python/test/test_garbage_collection_config.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.garbage_collection_config import GarbageCollectionConfig # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.garbage_collection_config import GarbageCollectionConfig class TestGarbageCollectionConfig(unittest.TestCase): """GarbageCollectionConfig unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GarbageCollectionConfig: """Test GarbageCollectionConfig - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `GarbageCollectionConfig` """ - model = lakefs_sdk.models.garbage_collection_config.GarbageCollectionConfig() # noqa: E501 - if include_optional : + model = GarbageCollectionConfig() + if include_optional: return GarbageCollectionConfig( grace_period = 56 ) - else : + else: return GarbageCollectionConfig( ) """ diff --git a/clients/python/test/test_garbage_collection_prepare_response.py b/clients/python/test/test_garbage_collection_prepare_response.py index 9979cce0d43..c627070c737 100644 --- a/clients/python/test/test_garbage_collection_prepare_response.py +++ b/clients/python/test/test_garbage_collection_prepare_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.garbage_collection_prepare_response import GarbageCollectionPrepareResponse # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.garbage_collection_prepare_response import GarbageCollectionPrepareResponse class TestGarbageCollectionPrepareResponse(unittest.TestCase): """GarbageCollectionPrepareResponse unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GarbageCollectionPrepareResponse: """Test GarbageCollectionPrepareResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `GarbageCollectionPrepareResponse` """ - model = lakefs_sdk.models.garbage_collection_prepare_response.GarbageCollectionPrepareResponse() # noqa: E501 - if include_optional : + model = GarbageCollectionPrepareResponse() + if include_optional: return GarbageCollectionPrepareResponse( - run_id = '64eaa103-d726-4a33-bcb8-7c0b4abfe09e', - gc_commits_location = 's3://my-storage-namespace/_lakefs/retention/commits', - gc_addresses_location = 's3://my-storage-namespace/_lakefs/retention/addresses', + run_id = '64eaa103-d726-4a33-bcb8-7c0b4abfe09e', + gc_commits_location = 's3://my-storage-namespace/_lakefs/retention/commits', + gc_addresses_location = 's3://my-storage-namespace/_lakefs/retention/addresses', gc_commits_presigned_url = '' ) - else : + else: return GarbageCollectionPrepareResponse( run_id = '64eaa103-d726-4a33-bcb8-7c0b4abfe09e', gc_commits_location = 's3://my-storage-namespace/_lakefs/retention/commits', diff --git a/clients/python/test/test_garbage_collection_rule.py b/clients/python/test/test_garbage_collection_rule.py index f5a70bfd7f8..42e4ee7dbdd 100644 --- a/clients/python/test/test_garbage_collection_rule.py +++ b/clients/python/test/test_garbage_collection_rule.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.garbage_collection_rule import GarbageCollectionRule # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.garbage_collection_rule import GarbageCollectionRule class TestGarbageCollectionRule(unittest.TestCase): """GarbageCollectionRule unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GarbageCollectionRule: """Test GarbageCollectionRule - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `GarbageCollectionRule` """ - model = lakefs_sdk.models.garbage_collection_rule.GarbageCollectionRule() # noqa: E501 - if include_optional : + model = GarbageCollectionRule() + if include_optional: return GarbageCollectionRule( - branch_id = '', + branch_id = '', retention_days = 56 ) - else : + else: return GarbageCollectionRule( branch_id = '', retention_days = 56, diff --git a/clients/python/test/test_garbage_collection_rules.py b/clients/python/test/test_garbage_collection_rules.py index 5b73d386305..e78a171b421 100644 --- a/clients/python/test/test_garbage_collection_rules.py +++ b/clients/python/test/test_garbage_collection_rules.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules class TestGarbageCollectionRules(unittest.TestCase): """GarbageCollectionRules unit test stubs""" @@ -29,24 +26,24 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GarbageCollectionRules: """Test GarbageCollectionRules - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `GarbageCollectionRules` """ - model = lakefs_sdk.models.garbage_collection_rules.GarbageCollectionRules() # noqa: E501 - if include_optional : + model = GarbageCollectionRules() + if include_optional: return GarbageCollectionRules( - default_retention_days = 56, + default_retention_days = 56, branches = [ lakefs_sdk.models.garbage_collection_rule.GarbageCollectionRule( branch_id = '', retention_days = 56, ) ] ) - else : + else: return GarbageCollectionRules( default_retention_days = 56, branches = [ diff --git a/clients/python/test/test_group.py b/clients/python/test/test_group.py index 14581363560..14050e0565f 100644 --- a/clients/python/test/test_group.py +++ b/clients/python/test/test_group.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.group import Group # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.group import Group class TestGroup(unittest.TestCase): """Group unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Group: """Test Group - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Group` """ - model = lakefs_sdk.models.group.Group() # noqa: E501 - if include_optional : + model = Group() + if include_optional: return Group( - id = '', - name = '', + id = '', + name = '', creation_date = 56 ) - else : + else: return Group( id = '', creation_date = 56, diff --git a/clients/python/test/test_group_creation.py b/clients/python/test/test_group_creation.py index 177c3e79222..8e31f64497e 100644 --- a/clients/python/test/test_group_creation.py +++ b/clients/python/test/test_group_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.group_creation import GroupCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.group_creation import GroupCreation class TestGroupCreation(unittest.TestCase): """GroupCreation unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GroupCreation: """Test GroupCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `GroupCreation` """ - model = lakefs_sdk.models.group_creation.GroupCreation() # noqa: E501 - if include_optional : + model = GroupCreation() + if include_optional: return GroupCreation( id = '' ) - else : + else: return GroupCreation( id = '', ) diff --git a/clients/python/test/test_group_list.py b/clients/python/test/test_group_list.py index f0595ddb09c..450c6d75298 100644 --- a/clients/python/test/test_group_list.py +++ b/clients/python/test/test_group_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.group_list import GroupList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.group_list import GroupList class TestGroupList(unittest.TestCase): """GroupList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GroupList: """Test GroupList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `GroupList` """ - model = lakefs_sdk.models.group_list.GroupList() # noqa: E501 - if include_optional : + model = GroupList() + if include_optional: return GroupList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.group.Group( id = '', @@ -51,7 +48,7 @@ def make_instance(self, include_optional): creation_date = 56, ) ] ) - else : + else: return GroupList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_health_check_api.py b/clients/python/test/test_health_check_api.py index e4d4f5a45aa..17cfe5ac672 100644 --- a/clients/python/test/test_health_check_api.py +++ b/clients/python/test/test_health_check_api.py @@ -15,21 +15,19 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.health_check_api import HealthCheckApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.health_check_api import HealthCheckApi class TestHealthCheckApi(unittest.TestCase): """HealthCheckApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.health_check_api.HealthCheckApi() # noqa: E501 + def setUp(self) -> None: + self.api = HealthCheckApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_health_check(self): + def test_health_check(self) -> None: """Test case for health_check """ diff --git a/clients/python/test/test_hook_run.py b/clients/python/test/test_hook_run.py index 60a901af7d5..5f5d655d5de 100644 --- a/clients/python/test/test_hook_run.py +++ b/clients/python/test/test_hook_run.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.hook_run import HookRun # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.hook_run import HookRun class TestHookRun(unittest.TestCase): """HookRun unit test stubs""" @@ -29,24 +26,24 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> HookRun: """Test HookRun - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `HookRun` """ - model = lakefs_sdk.models.hook_run.HookRun() # noqa: E501 - if include_optional : + model = HookRun() + if include_optional: return HookRun( - hook_run_id = '', - action = '', - hook_id = '', - start_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - end_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + hook_run_id = '', + action = '', + hook_id = '', + start_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + end_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), status = 'failed' ) - else : + else: return HookRun( hook_run_id = '', action = '', diff --git a/clients/python/test/test_hook_run_list.py b/clients/python/test/test_hook_run_list.py index 6b2fde9196a..b15ddfb963c 100644 --- a/clients/python/test/test_hook_run_list.py +++ b/clients/python/test/test_hook_run_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.hook_run_list import HookRunList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.hook_run_list import HookRunList class TestHookRunList(unittest.TestCase): """HookRunList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> HookRunList: """Test HookRunList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `HookRunList` """ - model = lakefs_sdk.models.hook_run_list.HookRunList() # noqa: E501 - if include_optional : + model = HookRunList() + if include_optional: return HookRunList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.hook_run.HookRun( hook_run_id = '', @@ -54,7 +51,7 @@ def make_instance(self, include_optional): status = 'failed', ) ] ) - else : + else: return HookRunList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_import_api.py b/clients/python/test/test_import_api.py index bddd116d1e5..41ab19cc849 100644 --- a/clients/python/test/test_import_api.py +++ b/clients/python/test/test_import_api.py @@ -15,38 +15,36 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.import_api import ImportApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.import_api import ImportApi class TestImportApi(unittest.TestCase): """ImportApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.import_api.ImportApi() # noqa: E501 + def setUp(self) -> None: + self.api = ImportApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_import_cancel(self): + def test_import_cancel(self) -> None: """Test case for import_cancel - cancel ongoing import # noqa: E501 + cancel ongoing import """ pass - def test_import_start(self): + def test_import_start(self) -> None: """Test case for import_start - import data from object store # noqa: E501 + import data from object store """ pass - def test_import_status(self): + def test_import_status(self) -> None: """Test case for import_status - get import status # noqa: E501 + get import status """ pass diff --git a/clients/python/test/test_import_creation.py b/clients/python/test/test_import_creation.py index 488fc51b890..75dff507a7a 100644 --- a/clients/python/test/test_import_creation.py +++ b/clients/python/test/test_import_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.import_creation import ImportCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.import_creation import ImportCreation class TestImportCreation(unittest.TestCase): """ImportCreation unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ImportCreation: """Test ImportCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ImportCreation` """ - model = lakefs_sdk.models.import_creation.ImportCreation() # noqa: E501 - if include_optional : + model = ImportCreation() + if include_optional: return ImportCreation( paths = [ lakefs_sdk.models.import_location.ImportLocation( type = 'common_prefix', path = 's3://my-bucket/production/collections/', destination = 'collections/', ) - ], + ], commit = lakefs_sdk.models.commit_creation.CommitCreation( message = '', metadata = { @@ -52,10 +49,10 @@ def make_instance(self, include_optional): }, date = 56, allow_empty = True, - force = True, ), + force = True, ), force = True ) - else : + else: return ImportCreation( paths = [ lakefs_sdk.models.import_location.ImportLocation( diff --git a/clients/python/test/test_import_creation_response.py b/clients/python/test/test_import_creation_response.py index 17d257fee29..9f924d96c1f 100644 --- a/clients/python/test/test_import_creation_response.py +++ b/clients/python/test/test_import_creation_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.import_creation_response import ImportCreationResponse # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.import_creation_response import ImportCreationResponse class TestImportCreationResponse(unittest.TestCase): """ImportCreationResponse unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ImportCreationResponse: """Test ImportCreationResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ImportCreationResponse` """ - model = lakefs_sdk.models.import_creation_response.ImportCreationResponse() # noqa: E501 - if include_optional : + model = ImportCreationResponse() + if include_optional: return ImportCreationResponse( id = '' ) - else : + else: return ImportCreationResponse( id = '', ) diff --git a/clients/python/test/test_import_location.py b/clients/python/test/test_import_location.py index 397d6fbee77..f57313fe1a5 100644 --- a/clients/python/test/test_import_location.py +++ b/clients/python/test/test_import_location.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.import_location import ImportLocation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.import_location import ImportLocation class TestImportLocation(unittest.TestCase): """ImportLocation unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ImportLocation: """Test ImportLocation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ImportLocation` """ - model = lakefs_sdk.models.import_location.ImportLocation() # noqa: E501 - if include_optional : + model = ImportLocation() + if include_optional: return ImportLocation( - type = 'common_prefix', - path = 's3://my-bucket/production/collections/', + type = 'common_prefix', + path = 's3://my-bucket/production/collections/', destination = 'collections/' ) - else : + else: return ImportLocation( type = 'common_prefix', path = 's3://my-bucket/production/collections/', diff --git a/clients/python/test/test_import_status.py b/clients/python/test/test_import_status.py index 4e560375f62..48d835ffcdd 100644 --- a/clients/python/test/test_import_status.py +++ b/clients/python/test/test_import_status.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.import_status import ImportStatus # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.import_status import ImportStatus class TestImportStatus(unittest.TestCase): """ImportStatus unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ImportStatus: """Test ImportStatus - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ImportStatus` """ - model = lakefs_sdk.models.import_status.ImportStatus() # noqa: E501 - if include_optional : + model = ImportStatus() + if include_optional: return ImportStatus( - completed = True, - update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - ingested_objects = 56, - metarange_id = '', + completed = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ingested_objects = 56, + metarange_id = '', commit = lakefs_sdk.models.commit.Commit( id = '', parents = [ @@ -56,11 +53,11 @@ def make_instance(self, include_optional): 'key' : '' }, generation = 56, - version = 0, ), + version = 0, ), error = lakefs_sdk.models.error.Error( message = '', ) ) - else : + else: return ImportStatus( completed = True, update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), diff --git a/clients/python/test/test_installation_usage_report.py b/clients/python/test/test_installation_usage_report.py index 029e02abe31..bbd5e41c831 100644 --- a/clients/python/test/test_installation_usage_report.py +++ b/clients/python/test/test_installation_usage_report.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.installation_usage_report import InstallationUsageReport # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.installation_usage_report import InstallationUsageReport class TestInstallationUsageReport(unittest.TestCase): """InstallationUsageReport unit test stubs""" @@ -29,17 +26,17 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> InstallationUsageReport: """Test InstallationUsageReport - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `InstallationUsageReport` """ - model = lakefs_sdk.models.installation_usage_report.InstallationUsageReport() # noqa: E501 - if include_optional : + model = InstallationUsageReport() + if include_optional: return InstallationUsageReport( - installation_id = '', + installation_id = '', reports = [ lakefs_sdk.models.usage_report.UsageReport( year = 56, @@ -47,7 +44,7 @@ def make_instance(self, include_optional): count = 56, ) ] ) - else : + else: return InstallationUsageReport( installation_id = '', reports = [ diff --git a/clients/python/test/test_internal_api.py b/clients/python/test/test_internal_api.py index 21c6fe63e3c..b445bf395e7 100644 --- a/clients/python/test/test_internal_api.py +++ b/clients/python/test/test_internal_api.py @@ -15,200 +15,198 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.internal_api import InternalApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.internal_api import InternalApi class TestInternalApi(unittest.TestCase): """InternalApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.internal_api.InternalApi() # noqa: E501 + def setUp(self) -> None: + self.api = InternalApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_create_branch_protection_rule_preflight(self): + def test_create_branch_protection_rule_preflight(self) -> None: """Test case for create_branch_protection_rule_preflight """ pass - def test_create_commit_record(self): + def test_create_commit_record(self) -> None: """Test case for create_commit_record - create commit record # noqa: E501 + create commit record """ pass - def test_create_symlink_file(self): + def test_create_symlink_file(self) -> None: """Test case for create_symlink_file - creates symlink files corresponding to the given directory # noqa: E501 + creates symlink files corresponding to the given directory """ pass - def test_delete_repository_metadata(self): + def test_delete_repository_metadata(self) -> None: """Test case for delete_repository_metadata - delete repository metadata # noqa: E501 + delete repository metadata """ pass - def test_dump_refs(self): + def test_dump_refs(self) -> None: """Test case for dump_refs - Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations # noqa: E501 + Dump repository refs (tags, commits, branches) to object store Deprecated: a new API will introduce long running operations """ pass - def test_get_auth_capabilities(self): + def test_get_auth_capabilities(self) -> None: """Test case for get_auth_capabilities - list authentication capabilities supported # noqa: E501 + list authentication capabilities supported """ pass - def test_get_garbage_collection_config(self): + def test_get_garbage_collection_config(self) -> None: """Test case for get_garbage_collection_config """ pass - def test_get_lake_fs_version(self): + def test_get_lake_fs_version(self) -> None: """Test case for get_lake_fs_version """ pass - def test_get_metadata_object(self): + def test_get_metadata_object(self) -> None: """Test case for get_metadata_object - return a lakeFS metadata object by ID # noqa: E501 + return a lakeFS metadata object by ID """ pass - def test_get_setup_state(self): + def test_get_setup_state(self) -> None: """Test case for get_setup_state - check if the lakeFS installation is already set up # noqa: E501 + check if the lakeFS installation is already set up """ pass - def test_get_storage_config(self): + def test_get_storage_config(self) -> None: """Test case for get_storage_config """ pass - def test_get_usage_report_summary(self): + def test_get_usage_report_summary(self) -> None: """Test case for get_usage_report_summary - get usage report summary # noqa: E501 + get usage report summary """ pass - def test_internal_create_branch_protection_rule(self): + def test_internal_create_branch_protection_rule(self) -> None: """Test case for internal_create_branch_protection_rule """ pass - def test_internal_delete_branch_protection_rule(self): + def test_internal_delete_branch_protection_rule(self) -> None: """Test case for internal_delete_branch_protection_rule """ pass - def test_internal_delete_garbage_collection_rules(self): + def test_internal_delete_garbage_collection_rules(self) -> None: """Test case for internal_delete_garbage_collection_rules """ pass - def test_internal_get_branch_protection_rules(self): + def test_internal_get_branch_protection_rules(self) -> None: """Test case for internal_get_branch_protection_rules - get branch protection rules # noqa: E501 + get branch protection rules """ pass - def test_internal_get_garbage_collection_rules(self): + def test_internal_get_garbage_collection_rules(self) -> None: """Test case for internal_get_garbage_collection_rules """ pass - def test_internal_set_garbage_collection_rules(self): + def test_internal_set_garbage_collection_rules(self) -> None: """Test case for internal_set_garbage_collection_rules """ pass - def test_post_stats_events(self): + def test_post_stats_events(self) -> None: """Test case for post_stats_events - post stats events, this endpoint is meant for internal use only # noqa: E501 + post stats events, this endpoint is meant for internal use only """ pass - def test_prepare_garbage_collection_commits(self): + def test_prepare_garbage_collection_commits(self) -> None: """Test case for prepare_garbage_collection_commits - save lists of active commits for garbage collection # noqa: E501 + save lists of active commits for garbage collection """ pass - def test_prepare_garbage_collection_uncommitted(self): + def test_prepare_garbage_collection_uncommitted(self) -> None: """Test case for prepare_garbage_collection_uncommitted - save repository uncommitted metadata for garbage collection # noqa: E501 + save repository uncommitted metadata for garbage collection """ pass - def test_restore_refs(self): + def test_restore_refs(self) -> None: """Test case for restore_refs - Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations # noqa: E501 + Restore repository refs (tags, commits, branches) from object store. Deprecated: a new API will introduce long running operations """ pass - def test_set_garbage_collection_rules_preflight(self): + def test_set_garbage_collection_rules_preflight(self) -> None: """Test case for set_garbage_collection_rules_preflight """ pass - def test_set_repository_metadata(self): + def test_set_repository_metadata(self) -> None: """Test case for set_repository_metadata - set repository metadata # noqa: E501 + set repository metadata """ pass - def test_setup(self): + def test_setup(self) -> None: """Test case for setup - setup lakeFS and create a first user # noqa: E501 + setup lakeFS and create a first user """ pass - def test_setup_comm_prefs(self): + def test_setup_comm_prefs(self) -> None: """Test case for setup_comm_prefs - setup communications preferences # noqa: E501 + setup communications preferences """ pass - def test_stage_object(self): + def test_stage_object(self) -> None: """Test case for stage_object - stage an object's metadata for the given branch # noqa: E501 + stage an object's metadata for the given branch """ pass - def test_upload_object_preflight(self): + def test_upload_object_preflight(self) -> None: """Test case for upload_object_preflight """ diff --git a/clients/python/test/test_internal_delete_branch_protection_rule_request.py b/clients/python/test/test_internal_delete_branch_protection_rule_request.py index 6ffda20d0e5..d80e7f05f67 100644 --- a/clients/python/test/test_internal_delete_branch_protection_rule_request.py +++ b/clients/python/test/test_internal_delete_branch_protection_rule_request.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.internal_delete_branch_protection_rule_request import InternalDeleteBranchProtectionRuleRequest # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.internal_delete_branch_protection_rule_request import InternalDeleteBranchProtectionRuleRequest class TestInternalDeleteBranchProtectionRuleRequest(unittest.TestCase): """InternalDeleteBranchProtectionRuleRequest unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> InternalDeleteBranchProtectionRuleRequest: """Test InternalDeleteBranchProtectionRuleRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `InternalDeleteBranchProtectionRuleRequest` """ - model = lakefs_sdk.models.internal_delete_branch_protection_rule_request.InternalDeleteBranchProtectionRuleRequest() # noqa: E501 - if include_optional : + model = InternalDeleteBranchProtectionRuleRequest() + if include_optional: return InternalDeleteBranchProtectionRuleRequest( pattern = '' ) - else : + else: return InternalDeleteBranchProtectionRuleRequest( pattern = '', ) diff --git a/clients/python/test/test_login_config.py b/clients/python/test/test_login_config.py index 60fc492974d..1fbae60e87a 100644 --- a/clients/python/test/test_login_config.py +++ b/clients/python/test/test_login_config.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.login_config import LoginConfig # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.login_config import LoginConfig class TestLoginConfig(unittest.TestCase): """LoginConfig unit test stubs""" @@ -29,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> LoginConfig: """Test LoginConfig - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `LoginConfig` """ - model = lakefs_sdk.models.login_config.LoginConfig() # noqa: E501 - if include_optional : + model = LoginConfig() + if include_optional: return LoginConfig( - rbac = 'simplified', - login_url = '', - login_failed_message = '', - fallback_login_url = '', - fallback_login_label = '', + rbac = 'simplified', + login_url = '', + login_failed_message = '', + fallback_login_url = '', + fallback_login_label = '', login_cookie_names = [ '' - ], + ], logout_url = '' ) - else : + else: return LoginConfig( login_url = '', login_cookie_names = [ diff --git a/clients/python/test/test_login_information.py b/clients/python/test/test_login_information.py index a269b7e5b21..ff5255488ca 100644 --- a/clients/python/test/test_login_information.py +++ b/clients/python/test/test_login_information.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.login_information import LoginInformation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.login_information import LoginInformation class TestLoginInformation(unittest.TestCase): """LoginInformation unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> LoginInformation: """Test LoginInformation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `LoginInformation` """ - model = lakefs_sdk.models.login_information.LoginInformation() # noqa: E501 - if include_optional : + model = LoginInformation() + if include_optional: return LoginInformation( - access_key_id = '', + access_key_id = '', secret_access_key = '' ) - else : + else: return LoginInformation( access_key_id = '', secret_access_key = '', diff --git a/clients/python/test/test_merge.py b/clients/python/test/test_merge.py index d22970adb56..bbed0963bf0 100644 --- a/clients/python/test/test_merge.py +++ b/clients/python/test/test_merge.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.merge import Merge # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.merge import Merge class TestMerge(unittest.TestCase): """Merge unit test stubs""" @@ -29,25 +26,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Merge: """Test Merge - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Merge` """ - model = lakefs_sdk.models.merge.Merge() # noqa: E501 - if include_optional : + model = Merge() + if include_optional: return Merge( - message = '', + message = '', metadata = { 'key' : '' - }, - strategy = '', - force = True, + }, + strategy = '', + force = True, allow_empty = True ) - else : + else: return Merge( ) """ diff --git a/clients/python/test/test_merge_result.py b/clients/python/test/test_merge_result.py index 8d630949c03..1b605fd4501 100644 --- a/clients/python/test/test_merge_result.py +++ b/clients/python/test/test_merge_result.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.merge_result import MergeResult # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.merge_result import MergeResult class TestMergeResult(unittest.TestCase): """MergeResult unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MergeResult: """Test MergeResult - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `MergeResult` """ - model = lakefs_sdk.models.merge_result.MergeResult() # noqa: E501 - if include_optional : + model = MergeResult() + if include_optional: return MergeResult( reference = '' ) - else : + else: return MergeResult( reference = '', ) diff --git a/clients/python/test/test_meta_range_creation.py b/clients/python/test/test_meta_range_creation.py index 4183bc4881d..4980a5f6f4c 100644 --- a/clients/python/test/test_meta_range_creation.py +++ b/clients/python/test/test_meta_range_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.meta_range_creation import MetaRangeCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.meta_range_creation import MetaRangeCreation class TestMetaRangeCreation(unittest.TestCase): """MetaRangeCreation unit test stubs""" @@ -29,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MetaRangeCreation: """Test MetaRangeCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `MetaRangeCreation` """ - model = lakefs_sdk.models.meta_range_creation.MetaRangeCreation() # noqa: E501 - if include_optional : + model = MetaRangeCreation() + if include_optional: return MetaRangeCreation( ranges = [ lakefs_sdk.models.range_metadata.RangeMetadata( @@ -48,7 +45,7 @@ def make_instance(self, include_optional): estimated_size = 56, ) ] ) - else : + else: return MetaRangeCreation( ranges = [ lakefs_sdk.models.range_metadata.RangeMetadata( diff --git a/clients/python/test/test_meta_range_creation_response.py b/clients/python/test/test_meta_range_creation_response.py index 3b756aa2981..641a415ce47 100644 --- a/clients/python/test/test_meta_range_creation_response.py +++ b/clients/python/test/test_meta_range_creation_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.meta_range_creation_response import MetaRangeCreationResponse # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.meta_range_creation_response import MetaRangeCreationResponse class TestMetaRangeCreationResponse(unittest.TestCase): """MetaRangeCreationResponse unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> MetaRangeCreationResponse: """Test MetaRangeCreationResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `MetaRangeCreationResponse` """ - model = lakefs_sdk.models.meta_range_creation_response.MetaRangeCreationResponse() # noqa: E501 - if include_optional : + model = MetaRangeCreationResponse() + if include_optional: return MetaRangeCreationResponse( id = '' ) - else : + else: return MetaRangeCreationResponse( ) """ diff --git a/clients/python/test/test_metadata_api.py b/clients/python/test/test_metadata_api.py index be2aca69db9..4fe61cbb9ea 100644 --- a/clients/python/test/test_metadata_api.py +++ b/clients/python/test/test_metadata_api.py @@ -15,31 +15,29 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.metadata_api import MetadataApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.metadata_api import MetadataApi class TestMetadataApi(unittest.TestCase): """MetadataApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.metadata_api.MetadataApi() # noqa: E501 + def setUp(self) -> None: + self.api = MetadataApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_meta_range(self): + def test_get_meta_range(self) -> None: """Test case for get_meta_range - return URI to a meta-range file # noqa: E501 + return URI to a meta-range file """ pass - def test_get_range(self): + def test_get_range(self) -> None: """Test case for get_range - return URI to a range file # noqa: E501 + return URI to a range file """ pass diff --git a/clients/python/test/test_object_copy_creation.py b/clients/python/test/test_object_copy_creation.py index 6e6959979d2..037862069fc 100644 --- a/clients/python/test/test_object_copy_creation.py +++ b/clients/python/test/test_object_copy_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation class TestObjectCopyCreation(unittest.TestCase): """ObjectCopyCreation unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ObjectCopyCreation: """Test ObjectCopyCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ObjectCopyCreation` """ - model = lakefs_sdk.models.object_copy_creation.ObjectCopyCreation() # noqa: E501 - if include_optional : + model = ObjectCopyCreation() + if include_optional: return ObjectCopyCreation( - src_path = '', - src_ref = '', + src_path = '', + src_ref = '', force = True ) - else : + else: return ObjectCopyCreation( src_path = '', ) diff --git a/clients/python/test/test_object_error.py b/clients/python/test/test_object_error.py index 3f6a83c2635..a4bb5b8bfe3 100644 --- a/clients/python/test/test_object_error.py +++ b/clients/python/test/test_object_error.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.object_error import ObjectError # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.object_error import ObjectError class TestObjectError(unittest.TestCase): """ObjectError unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ObjectError: """Test ObjectError - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ObjectError` """ - model = lakefs_sdk.models.object_error.ObjectError() # noqa: E501 - if include_optional : + model = ObjectError() + if include_optional: return ObjectError( - status_code = 56, - message = '', + status_code = 56, + message = '', path = '' ) - else : + else: return ObjectError( status_code = 56, message = '', diff --git a/clients/python/test/test_object_error_list.py b/clients/python/test/test_object_error_list.py index 82baab2df7d..06106ee478b 100644 --- a/clients/python/test/test_object_error_list.py +++ b/clients/python/test/test_object_error_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.object_error_list import ObjectErrorList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.object_error_list import ObjectErrorList class TestObjectErrorList(unittest.TestCase): """ObjectErrorList unit test stubs""" @@ -29,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ObjectErrorList: """Test ObjectErrorList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ObjectErrorList` """ - model = lakefs_sdk.models.object_error_list.ObjectErrorList() # noqa: E501 - if include_optional : + model = ObjectErrorList() + if include_optional: return ObjectErrorList( errors = [ lakefs_sdk.models.object_error.ObjectError( @@ -46,7 +43,7 @@ def make_instance(self, include_optional): path = '', ) ] ) - else : + else: return ObjectErrorList( errors = [ lakefs_sdk.models.object_error.ObjectError( diff --git a/clients/python/test/test_object_stage_creation.py b/clients/python/test/test_object_stage_creation.py index a31ab0c1f2d..c1d270c5d34 100644 --- a/clients/python/test/test_object_stage_creation.py +++ b/clients/python/test/test_object_stage_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.object_stage_creation import ObjectStageCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.object_stage_creation import ObjectStageCreation class TestObjectStageCreation(unittest.TestCase): """ObjectStageCreation unit test stubs""" @@ -29,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ObjectStageCreation: """Test ObjectStageCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ObjectStageCreation` """ - model = lakefs_sdk.models.object_stage_creation.ObjectStageCreation() # noqa: E501 - if include_optional : + model = ObjectStageCreation() + if include_optional: return ObjectStageCreation( - physical_address = '', - checksum = '', - size_bytes = 56, - mtime = 56, + physical_address = '', + checksum = '', + size_bytes = 56, + mtime = 56, metadata = { 'key' : '' - }, - content_type = '', + }, + content_type = '', force = True ) - else : + else: return ObjectStageCreation( physical_address = '', checksum = '', diff --git a/clients/python/test/test_object_stats.py b/clients/python/test/test_object_stats.py index 72df2398b1c..4075217df8d 100644 --- a/clients/python/test/test_object_stats.py +++ b/clients/python/test/test_object_stats.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.object_stats import ObjectStats # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.object_stats import ObjectStats class TestObjectStats(unittest.TestCase): """ObjectStats unit test stubs""" @@ -29,29 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ObjectStats: """Test ObjectStats - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ObjectStats` """ - model = lakefs_sdk.models.object_stats.ObjectStats() # noqa: E501 - if include_optional : + model = ObjectStats() + if include_optional: return ObjectStats( - path = '', - path_type = 'common_prefix', - physical_address = '', - physical_address_expiry = 56, - checksum = '', - size_bytes = 56, - mtime = 56, + path = '', + path_type = 'common_prefix', + physical_address = '', + physical_address_expiry = 56, + checksum = '', + size_bytes = 56, + mtime = 56, metadata = { 'key' : '' - }, + }, content_type = '' ) - else : + else: return ObjectStats( path = '', path_type = 'common_prefix', diff --git a/clients/python/test/test_object_stats_list.py b/clients/python/test/test_object_stats_list.py index 7f723fdd8f4..07a1cf03b28 100644 --- a/clients/python/test/test_object_stats_list.py +++ b/clients/python/test/test_object_stats_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.object_stats_list import ObjectStatsList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.object_stats_list import ObjectStatsList class TestObjectStatsList(unittest.TestCase): """ObjectStatsList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ObjectStatsList: """Test ObjectStatsList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ObjectStatsList` """ - model = lakefs_sdk.models.object_stats_list.ObjectStatsList() # noqa: E501 - if include_optional : + model = ObjectStatsList() + if include_optional: return ObjectStatsList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.object_stats.ObjectStats( path = '', @@ -59,7 +56,7 @@ def make_instance(self, include_optional): content_type = '', ) ] ) - else : + else: return ObjectStatsList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_objects_api.py b/clients/python/test/test_objects_api.py index 334c3b05171..258a0cbeaf2 100644 --- a/clients/python/test/test_objects_api.py +++ b/clients/python/test/test_objects_api.py @@ -15,77 +15,75 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.objects_api import ObjectsApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.objects_api import ObjectsApi class TestObjectsApi(unittest.TestCase): """ObjectsApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.objects_api.ObjectsApi() # noqa: E501 + def setUp(self) -> None: + self.api = ObjectsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_copy_object(self): + def test_copy_object(self) -> None: """Test case for copy_object - create a copy of an object # noqa: E501 + create a copy of an object """ pass - def test_delete_object(self): + def test_delete_object(self) -> None: """Test case for delete_object - delete object. Missing objects will not return a NotFound error. # noqa: E501 + delete object. Missing objects will not return a NotFound error. """ pass - def test_delete_objects(self): + def test_delete_objects(self) -> None: """Test case for delete_objects - delete objects. Missing objects will not return a NotFound error. # noqa: E501 + delete objects. Missing objects will not return a NotFound error. """ pass - def test_get_object(self): + def test_get_object(self) -> None: """Test case for get_object - get object content # noqa: E501 + get object content """ pass - def test_get_underlying_properties(self): + def test_get_underlying_properties(self) -> None: """Test case for get_underlying_properties - get object properties on underlying storage # noqa: E501 + get object properties on underlying storage """ pass - def test_head_object(self): + def test_head_object(self) -> None: """Test case for head_object - check if object exists # noqa: E501 + check if object exists """ pass - def test_list_objects(self): + def test_list_objects(self) -> None: """Test case for list_objects - list objects under a given prefix # noqa: E501 + list objects under a given prefix """ pass - def test_stat_object(self): + def test_stat_object(self) -> None: """Test case for stat_object - get object metadata # noqa: E501 + get object metadata """ pass - def test_upload_object(self): + def test_upload_object(self) -> None: """Test case for upload_object """ diff --git a/clients/python/test/test_pagination.py b/clients/python/test/test_pagination.py index 0053f45e5df..c142ade2432 100644 --- a/clients/python/test/test_pagination.py +++ b/clients/python/test/test_pagination.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.pagination import Pagination # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.pagination import Pagination class TestPagination(unittest.TestCase): """Pagination unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Pagination: """Test Pagination - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Pagination` """ - model = lakefs_sdk.models.pagination.Pagination() # noqa: E501 - if include_optional : + model = Pagination() + if include_optional: return Pagination( - has_more = True, - next_offset = '', - results = 0, + has_more = True, + next_offset = '', + results = 0, max_per_page = 0 ) - else : + else: return Pagination( has_more = True, next_offset = '', diff --git a/clients/python/test/test_path_list.py b/clients/python/test/test_path_list.py index 67138140df3..4cc157e61f0 100644 --- a/clients/python/test/test_path_list.py +++ b/clients/python/test/test_path_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.path_list import PathList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.path_list import PathList class TestPathList(unittest.TestCase): """PathList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> PathList: """Test PathList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `PathList` """ - model = lakefs_sdk.models.path_list.PathList() # noqa: E501 - if include_optional : + model = PathList() + if include_optional: return PathList( paths = [ '' ] ) - else : + else: return PathList( paths = [ '' diff --git a/clients/python/test/test_policy.py b/clients/python/test/test_policy.py index 2f74adbbe05..70a2c8a3857 100644 --- a/clients/python/test/test_policy.py +++ b/clients/python/test/test_policy.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.policy import Policy # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.policy import Policy class TestPolicy(unittest.TestCase): """Policy unit test stubs""" @@ -29,18 +26,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Policy: """Test Policy - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Policy` """ - model = lakefs_sdk.models.policy.Policy() # noqa: E501 - if include_optional : + model = Policy() + if include_optional: return Policy( - id = '', - creation_date = 56, + id = '', + creation_date = 56, statement = [ lakefs_sdk.models.statement.Statement( effect = 'allow', @@ -50,7 +47,7 @@ def make_instance(self, include_optional): ], ) ] ) - else : + else: return Policy( id = '', statement = [ diff --git a/clients/python/test/test_policy_list.py b/clients/python/test/test_policy_list.py index ecba7fd6f91..8ed9c88cb5f 100644 --- a/clients/python/test/test_policy_list.py +++ b/clients/python/test/test_policy_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.policy_list import PolicyList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.policy_list import PolicyList class TestPolicyList(unittest.TestCase): """PolicyList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> PolicyList: """Test PolicyList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `PolicyList` """ - model = lakefs_sdk.models.policy_list.PolicyList() # noqa: E501 - if include_optional : + model = PolicyList() + if include_optional: return PolicyList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.policy.Policy( id = '', @@ -58,7 +55,7 @@ def make_instance(self, include_optional): ], ) ] ) - else : + else: return PolicyList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_prepare_gc_uncommitted_request.py b/clients/python/test/test_prepare_gc_uncommitted_request.py index 9e09818412e..0ab0b5025be 100644 --- a/clients/python/test/test_prepare_gc_uncommitted_request.py +++ b/clients/python/test/test_prepare_gc_uncommitted_request.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.prepare_gc_uncommitted_request import PrepareGCUncommittedRequest # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.prepare_gc_uncommitted_request import PrepareGCUncommittedRequest class TestPrepareGCUncommittedRequest(unittest.TestCase): """PrepareGCUncommittedRequest unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> PrepareGCUncommittedRequest: """Test PrepareGCUncommittedRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `PrepareGCUncommittedRequest` """ - model = lakefs_sdk.models.prepare_gc_uncommitted_request.PrepareGCUncommittedRequest() # noqa: E501 - if include_optional : + model = PrepareGCUncommittedRequest() + if include_optional: return PrepareGCUncommittedRequest( continuation_token = '' ) - else : + else: return PrepareGCUncommittedRequest( ) """ diff --git a/clients/python/test/test_prepare_gc_uncommitted_response.py b/clients/python/test/test_prepare_gc_uncommitted_response.py index 5670cc90a29..14cbf91fac9 100644 --- a/clients/python/test/test_prepare_gc_uncommitted_response.py +++ b/clients/python/test/test_prepare_gc_uncommitted_response.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.prepare_gc_uncommitted_response import PrepareGCUncommittedResponse # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.prepare_gc_uncommitted_response import PrepareGCUncommittedResponse class TestPrepareGCUncommittedResponse(unittest.TestCase): """PrepareGCUncommittedResponse unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> PrepareGCUncommittedResponse: """Test PrepareGCUncommittedResponse - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `PrepareGCUncommittedResponse` """ - model = lakefs_sdk.models.prepare_gc_uncommitted_response.PrepareGCUncommittedResponse() # noqa: E501 - if include_optional : + model = PrepareGCUncommittedResponse() + if include_optional: return PrepareGCUncommittedResponse( - run_id = '', - gc_uncommitted_location = '', + run_id = '', + gc_uncommitted_location = '', continuation_token = '' ) - else : + else: return PrepareGCUncommittedResponse( run_id = '', gc_uncommitted_location = '', diff --git a/clients/python/test/test_presign_multipart_upload.py b/clients/python/test/test_presign_multipart_upload.py index 7de349a1fa5..27fd6106a80 100644 --- a/clients/python/test/test_presign_multipart_upload.py +++ b/clients/python/test/test_presign_multipart_upload.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.presign_multipart_upload import PresignMultipartUpload class TestPresignMultipartUpload(unittest.TestCase): """PresignMultipartUpload unit test stubs""" @@ -29,23 +26,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> PresignMultipartUpload: """Test PresignMultipartUpload - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `PresignMultipartUpload` """ - model = lakefs_sdk.models.presign_multipart_upload.PresignMultipartUpload() # noqa: E501 - if include_optional : + model = PresignMultipartUpload() + if include_optional: return PresignMultipartUpload( - upload_id = '', - physical_address = '', + upload_id = '', + physical_address = '', presigned_urls = [ '' ] ) - else : + else: return PresignMultipartUpload( upload_id = '', physical_address = '', diff --git a/clients/python/test/test_range_metadata.py b/clients/python/test/test_range_metadata.py index f63914a623a..33b76a075d3 100644 --- a/clients/python/test/test_range_metadata.py +++ b/clients/python/test/test_range_metadata.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.range_metadata import RangeMetadata # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.range_metadata import RangeMetadata class TestRangeMetadata(unittest.TestCase): """RangeMetadata unit test stubs""" @@ -29,23 +26,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RangeMetadata: """Test RangeMetadata - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RangeMetadata` """ - model = lakefs_sdk.models.range_metadata.RangeMetadata() # noqa: E501 - if include_optional : + model = RangeMetadata() + if include_optional: return RangeMetadata( - id = '480e19972a6fbe98ab8e81ae5efdfd1a29037587e91244e87abd4adefffdb01c', - min_key = 'production/collections/some/file_1.parquet', - max_key = 'production/collections/some/file_8229.parquet', - count = 56, + id = '480e19972a6fbe98ab8e81ae5efdfd1a29037587e91244e87abd4adefffdb01c', + min_key = 'production/collections/some/file_1.parquet', + max_key = 'production/collections/some/file_8229.parquet', + count = 56, estimated_size = 56 ) - else : + else: return RangeMetadata( id = '480e19972a6fbe98ab8e81ae5efdfd1a29037587e91244e87abd4adefffdb01c', min_key = 'production/collections/some/file_1.parquet', diff --git a/clients/python/test/test_ref.py b/clients/python/test/test_ref.py index 71efcd298db..b609d03d466 100644 --- a/clients/python/test/test_ref.py +++ b/clients/python/test/test_ref.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.ref import Ref # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.ref import Ref class TestRef(unittest.TestCase): """Ref unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Ref: """Test Ref - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Ref` """ - model = lakefs_sdk.models.ref.Ref() # noqa: E501 - if include_optional : + model = Ref() + if include_optional: return Ref( - id = '', + id = '', commit_id = '' ) - else : + else: return Ref( id = '', commit_id = '', diff --git a/clients/python/test/test_ref_list.py b/clients/python/test/test_ref_list.py index 9cf7b23bada..6760cfa844d 100644 --- a/clients/python/test/test_ref_list.py +++ b/clients/python/test/test_ref_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.ref_list import RefList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.ref_list import RefList class TestRefList(unittest.TestCase): """RefList unit test stubs""" @@ -29,28 +26,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RefList: """Test RefList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RefList` """ - model = lakefs_sdk.models.ref_list.RefList() # noqa: E501 - if include_optional : + model = RefList() + if include_optional: return RefList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.ref.Ref( id = '', commit_id = '', ) ] ) - else : + else: return RefList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_refs_api.py b/clients/python/test/test_refs_api.py index 8000145c4ea..3e74853cc76 100644 --- a/clients/python/test/test_refs_api.py +++ b/clients/python/test/test_refs_api.py @@ -15,45 +15,43 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.refs_api import RefsApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.refs_api import RefsApi class TestRefsApi(unittest.TestCase): """RefsApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.refs_api.RefsApi() # noqa: E501 + def setUp(self) -> None: + self.api = RefsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_diff_refs(self): + def test_diff_refs(self) -> None: """Test case for diff_refs - diff references # noqa: E501 + diff references """ pass - def test_find_merge_base(self): + def test_find_merge_base(self) -> None: """Test case for find_merge_base - find the merge base for 2 references # noqa: E501 + find the merge base for 2 references """ pass - def test_log_commits(self): + def test_log_commits(self) -> None: """Test case for log_commits - get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 + get commit log from ref. If both objects and prefixes are empty, return all commits. """ pass - def test_merge_into_branch(self): + def test_merge_into_branch(self) -> None: """Test case for merge_into_branch - merge references # noqa: E501 + merge references """ pass diff --git a/clients/python/test/test_refs_dump.py b/clients/python/test/test_refs_dump.py index ebbba835cef..04f94c9b7ce 100644 --- a/clients/python/test/test_refs_dump.py +++ b/clients/python/test/test_refs_dump.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.refs_dump import RefsDump # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.refs_dump import RefsDump class TestRefsDump(unittest.TestCase): """RefsDump unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RefsDump: """Test RefsDump - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RefsDump` """ - model = lakefs_sdk.models.refs_dump.RefsDump() # noqa: E501 - if include_optional : + model = RefsDump() + if include_optional: return RefsDump( - commits_meta_range_id = '', - tags_meta_range_id = '', + commits_meta_range_id = '', + tags_meta_range_id = '', branches_meta_range_id = '' ) - else : + else: return RefsDump( commits_meta_range_id = '', tags_meta_range_id = '', diff --git a/clients/python/test/test_refs_restore.py b/clients/python/test/test_refs_restore.py index 3012307a1b5..6df5b8d90ed 100644 --- a/clients/python/test/test_refs_restore.py +++ b/clients/python/test/test_refs_restore.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.refs_restore import RefsRestore # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.refs_restore import RefsRestore class TestRefsRestore(unittest.TestCase): """RefsRestore unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RefsRestore: """Test RefsRestore - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RefsRestore` """ - model = lakefs_sdk.models.refs_restore.RefsRestore() # noqa: E501 - if include_optional : + model = RefsRestore() + if include_optional: return RefsRestore( - commits_meta_range_id = '', - tags_meta_range_id = '', - branches_meta_range_id = '', + commits_meta_range_id = '', + tags_meta_range_id = '', + branches_meta_range_id = '', force = True ) - else : + else: return RefsRestore( commits_meta_range_id = '', tags_meta_range_id = '', diff --git a/clients/python/test/test_repositories_api.py b/clients/python/test/test_repositories_api.py index 59ffd7d53fc..269bb34cb33 100644 --- a/clients/python/test/test_repositories_api.py +++ b/clients/python/test/test_repositories_api.py @@ -15,110 +15,108 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.repositories_api import RepositoriesApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.repositories_api import RepositoriesApi class TestRepositoriesApi(unittest.TestCase): """RepositoriesApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.repositories_api.RepositoriesApi() # noqa: E501 + def setUp(self) -> None: + self.api = RepositoriesApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_create_repository(self): + def test_create_repository(self) -> None: """Test case for create_repository - create repository # noqa: E501 + create repository """ pass - def test_delete_gc_rules(self): + def test_delete_gc_rules(self) -> None: """Test case for delete_gc_rules """ pass - def test_delete_repository(self): + def test_delete_repository(self) -> None: """Test case for delete_repository - delete repository # noqa: E501 + delete repository """ pass - def test_dump_status(self): + def test_dump_status(self) -> None: """Test case for dump_status - Status of a repository dump task # noqa: E501 + Status of a repository dump task """ pass - def test_dump_submit(self): + def test_dump_submit(self) -> None: """Test case for dump_submit - Backup the repository metadata (tags, commits, branches) and save the backup to the object store. # noqa: E501 + Backup the repository metadata (tags, commits, branches) and save the backup to the object store. """ pass - def test_get_branch_protection_rules(self): + def test_get_branch_protection_rules(self) -> None: """Test case for get_branch_protection_rules - get branch protection rules # noqa: E501 + get branch protection rules """ pass - def test_get_gc_rules(self): + def test_get_gc_rules(self) -> None: """Test case for get_gc_rules - get repository GC rules # noqa: E501 + get repository GC rules """ pass - def test_get_repository(self): + def test_get_repository(self) -> None: """Test case for get_repository - get repository # noqa: E501 + get repository """ pass - def test_get_repository_metadata(self): + def test_get_repository_metadata(self) -> None: """Test case for get_repository_metadata - get repository metadata # noqa: E501 + get repository metadata """ pass - def test_list_repositories(self): + def test_list_repositories(self) -> None: """Test case for list_repositories - list repositories # noqa: E501 + list repositories """ pass - def test_restore_status(self): + def test_restore_status(self) -> None: """Test case for restore_status - Status of a restore request # noqa: E501 + Status of a restore request """ pass - def test_restore_submit(self): + def test_restore_submit(self) -> None: """Test case for restore_submit - Restore repository from a dump in the object store # noqa: E501 + Restore repository from a dump in the object store """ pass - def test_set_branch_protection_rules(self): + def test_set_branch_protection_rules(self) -> None: """Test case for set_branch_protection_rules """ pass - def test_set_gc_rules(self): + def test_set_gc_rules(self) -> None: """Test case for set_gc_rules """ diff --git a/clients/python/test/test_repository.py b/clients/python/test/test_repository.py index 7ba2d7937fa..e92fe86d170 100644 --- a/clients/python/test/test_repository.py +++ b/clients/python/test/test_repository.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository import Repository # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository import Repository class TestRepository(unittest.TestCase): """Repository unit test stubs""" @@ -29,23 +26,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Repository: """Test Repository - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Repository` """ - model = lakefs_sdk.models.repository.Repository() # noqa: E501 - if include_optional : + model = Repository() + if include_optional: return Repository( - id = '', - creation_date = 56, - default_branch = '', - storage_namespace = '', + id = '', + creation_date = 56, + default_branch = '', + storage_namespace = '', read_only = True ) - else : + else: return Repository( id = '', creation_date = 56, diff --git a/clients/python/test/test_repository_creation.py b/clients/python/test/test_repository_creation.py index 731d0d188f4..e021164a7d8 100644 --- a/clients/python/test/test_repository_creation.py +++ b/clients/python/test/test_repository_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository_creation import RepositoryCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository_creation import RepositoryCreation class TestRepositoryCreation(unittest.TestCase): """RepositoryCreation unit test stubs""" @@ -29,23 +26,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RepositoryCreation: """Test RepositoryCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RepositoryCreation` """ - model = lakefs_sdk.models.repository_creation.RepositoryCreation() # noqa: E501 - if include_optional : + model = RepositoryCreation() + if include_optional: return RepositoryCreation( - name = 'wr1c2v7s6djuy1zmeto', - storage_namespace = 's3://example-bucket/', - default_branch = 'main', - sample_data = True, + name = 'wr1c2v7s6djuy1zmeto', + storage_namespace = 's3://example-bucket/', + default_branch = 'main', + sample_data = True, read_only = True ) - else : + else: return RepositoryCreation( name = 'wr1c2v7s6djuy1zmeto', storage_namespace = 's3://example-bucket/', diff --git a/clients/python/test/test_repository_dump_status.py b/clients/python/test/test_repository_dump_status.py index a38ce0a3e8c..d8bb0acde77 100644 --- a/clients/python/test/test_repository_dump_status.py +++ b/clients/python/test/test_repository_dump_status.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository_dump_status import RepositoryDumpStatus # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository_dump_status import RepositoryDumpStatus class TestRepositoryDumpStatus(unittest.TestCase): """RepositoryDumpStatus unit test stubs""" @@ -29,26 +26,26 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RepositoryDumpStatus: """Test RepositoryDumpStatus - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RepositoryDumpStatus` """ - model = lakefs_sdk.models.repository_dump_status.RepositoryDumpStatus() # noqa: E501 - if include_optional : + model = RepositoryDumpStatus() + if include_optional: return RepositoryDumpStatus( - id = '', - done = True, - update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - error = '', + id = '', + done = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + error = '', refs = lakefs_sdk.models.refs_dump.RefsDump( commits_meta_range_id = '', tags_meta_range_id = '', branches_meta_range_id = '', ) ) - else : + else: return RepositoryDumpStatus( id = '', done = True, diff --git a/clients/python/test/test_repository_list.py b/clients/python/test/test_repository_list.py index 72beb45a0b5..e6f381875c2 100644 --- a/clients/python/test/test_repository_list.py +++ b/clients/python/test/test_repository_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository_list import RepositoryList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository_list import RepositoryList class TestRepositoryList(unittest.TestCase): """RepositoryList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RepositoryList: """Test RepositoryList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RepositoryList` """ - model = lakefs_sdk.models.repository_list.RepositoryList() # noqa: E501 - if include_optional : + model = RepositoryList() + if include_optional: return RepositoryList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.repository.Repository( id = '', @@ -53,7 +50,7 @@ def make_instance(self, include_optional): read_only = True, ) ] ) - else : + else: return RepositoryList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_repository_metadata_keys.py b/clients/python/test/test_repository_metadata_keys.py index 55393ec97d3..160ff630679 100644 --- a/clients/python/test/test_repository_metadata_keys.py +++ b/clients/python/test/test_repository_metadata_keys.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository_metadata_keys import RepositoryMetadataKeys # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository_metadata_keys import RepositoryMetadataKeys class TestRepositoryMetadataKeys(unittest.TestCase): """RepositoryMetadataKeys unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RepositoryMetadataKeys: """Test RepositoryMetadataKeys - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RepositoryMetadataKeys` """ - model = lakefs_sdk.models.repository_metadata_keys.RepositoryMetadataKeys() # noqa: E501 - if include_optional : + model = RepositoryMetadataKeys() + if include_optional: return RepositoryMetadataKeys( keys = [ '' ] ) - else : + else: return RepositoryMetadataKeys( keys = [ '' diff --git a/clients/python/test/test_repository_metadata_set.py b/clients/python/test/test_repository_metadata_set.py index 1508352547b..f88d5350326 100644 --- a/clients/python/test/test_repository_metadata_set.py +++ b/clients/python/test/test_repository_metadata_set.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository_metadata_set import RepositoryMetadataSet # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository_metadata_set import RepositoryMetadataSet class TestRepositoryMetadataSet(unittest.TestCase): """RepositoryMetadataSet unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RepositoryMetadataSet: """Test RepositoryMetadataSet - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RepositoryMetadataSet` """ - model = lakefs_sdk.models.repository_metadata_set.RepositoryMetadataSet() # noqa: E501 - if include_optional : + model = RepositoryMetadataSet() + if include_optional: return RepositoryMetadataSet( metadata = { 'key' : '' } ) - else : + else: return RepositoryMetadataSet( metadata = { 'key' : '' diff --git a/clients/python/test/test_repository_restore_status.py b/clients/python/test/test_repository_restore_status.py index 4d6fc3cbd7f..10781006bc5 100644 --- a/clients/python/test/test_repository_restore_status.py +++ b/clients/python/test/test_repository_restore_status.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.repository_restore_status import RepositoryRestoreStatus # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.repository_restore_status import RepositoryRestoreStatus class TestRepositoryRestoreStatus(unittest.TestCase): """RepositoryRestoreStatus unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RepositoryRestoreStatus: """Test RepositoryRestoreStatus - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RepositoryRestoreStatus` """ - model = lakefs_sdk.models.repository_restore_status.RepositoryRestoreStatus() # noqa: E501 - if include_optional : + model = RepositoryRestoreStatus() + if include_optional: return RepositoryRestoreStatus( - id = '', - done = True, - update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = '', + done = True, + update_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), error = '' ) - else : + else: return RepositoryRestoreStatus( id = '', done = True, diff --git a/clients/python/test/test_reset_creation.py b/clients/python/test/test_reset_creation.py index b30e9191bf4..3daa6b0d8d3 100644 --- a/clients/python/test/test_reset_creation.py +++ b/clients/python/test/test_reset_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.reset_creation import ResetCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.reset_creation import ResetCreation class TestResetCreation(unittest.TestCase): """ResetCreation unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ResetCreation: """Test ResetCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `ResetCreation` """ - model = lakefs_sdk.models.reset_creation.ResetCreation() # noqa: E501 - if include_optional : + model = ResetCreation() + if include_optional: return ResetCreation( - type = 'object', - path = '', + type = 'object', + path = '', force = True ) - else : + else: return ResetCreation( type = 'object', ) diff --git a/clients/python/test/test_revert_creation.py b/clients/python/test/test_revert_creation.py index 45447528598..4686df1a506 100644 --- a/clients/python/test/test_revert_creation.py +++ b/clients/python/test/test_revert_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.revert_creation import RevertCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.revert_creation import RevertCreation class TestRevertCreation(unittest.TestCase): """RevertCreation unit test stubs""" @@ -29,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RevertCreation: """Test RevertCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `RevertCreation` """ - model = lakefs_sdk.models.revert_creation.RevertCreation() # noqa: E501 - if include_optional : + model = RevertCreation() + if include_optional: return RevertCreation( - ref = '', + ref = '', commit_overrides = lakefs_sdk.models.commit_overrides.CommitOverrides( message = '', metadata = { 'key' : '' - }, ), - parent_number = 56, - force = True, + }, ), + parent_number = 56, + force = True, allow_empty = True ) - else : + else: return RevertCreation( ref = '', parent_number = 56, diff --git a/clients/python/test/test_setup.py b/clients/python/test/test_setup.py index 0519dd646b3..0fb40c4dbee 100644 --- a/clients/python/test/test_setup.py +++ b/clients/python/test/test_setup.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.setup import Setup # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.setup import Setup class TestSetup(unittest.TestCase): """Setup unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Setup: """Test Setup - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Setup` """ - model = lakefs_sdk.models.setup.Setup() # noqa: E501 - if include_optional : + model = Setup() + if include_optional: return Setup( - username = '', + username = '', key = lakefs_sdk.models.access_key_credentials.AccessKeyCredentials( access_key_id = 'AKIAIOSFODNN7EXAMPLE', secret_access_key = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', ) ) - else : + else: return Setup( username = '', ) diff --git a/clients/python/test/test_setup_state.py b/clients/python/test/test_setup_state.py index 1b981b93515..b23e79d68e7 100644 --- a/clients/python/test/test_setup_state.py +++ b/clients/python/test/test_setup_state.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.setup_state import SetupState # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.setup_state import SetupState class TestSetupState(unittest.TestCase): """SetupState unit test stubs""" @@ -29,18 +26,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SetupState: """Test SetupState - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `SetupState` """ - model = lakefs_sdk.models.setup_state.SetupState() # noqa: E501 - if include_optional : + model = SetupState() + if include_optional: return SetupState( - state = 'initialized', - comm_prefs_missing = True, + state = 'initialized', + comm_prefs_missing = True, login_config = lakefs_sdk.models.login_config.LoginConfig( rbac = 'simplified', login_url = '', @@ -52,7 +49,7 @@ def make_instance(self, include_optional): ], logout_url = '', ) ) - else : + else: return SetupState( ) """ diff --git a/clients/python/test/test_staging_api.py b/clients/python/test/test_staging_api.py index 2d7585a8b0e..ccc08677cb6 100644 --- a/clients/python/test/test_staging_api.py +++ b/clients/python/test/test_staging_api.py @@ -15,31 +15,29 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.staging_api import StagingApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.staging_api import StagingApi class TestStagingApi(unittest.TestCase): """StagingApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.staging_api.StagingApi() # noqa: E501 + def setUp(self) -> None: + self.api = StagingApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_physical_address(self): + def test_get_physical_address(self) -> None: """Test case for get_physical_address - generate an address to which the client can upload an object # noqa: E501 + generate an address to which the client can upload an object """ pass - def test_link_physical_address(self): + def test_link_physical_address(self) -> None: """Test case for link_physical_address - associate staging on this physical address with a path # noqa: E501 + associate staging on this physical address with a path """ pass diff --git a/clients/python/test/test_staging_location.py b/clients/python/test/test_staging_location.py index 63171c6d938..fd749224a59 100644 --- a/clients/python/test/test_staging_location.py +++ b/clients/python/test/test_staging_location.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.staging_location import StagingLocation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.staging_location import StagingLocation class TestStagingLocation(unittest.TestCase): """StagingLocation unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StagingLocation: """Test StagingLocation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StagingLocation` """ - model = lakefs_sdk.models.staging_location.StagingLocation() # noqa: E501 - if include_optional : + model = StagingLocation() + if include_optional: return StagingLocation( - physical_address = '', - presigned_url = '', + physical_address = '', + presigned_url = '', presigned_url_expiry = 56 ) - else : + else: return StagingLocation( ) """ diff --git a/clients/python/test/test_staging_metadata.py b/clients/python/test/test_staging_metadata.py index 3623b7c8884..e85177cdd55 100644 --- a/clients/python/test/test_staging_metadata.py +++ b/clients/python/test/test_staging_metadata.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.staging_metadata import StagingMetadata # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.staging_metadata import StagingMetadata class TestStagingMetadata(unittest.TestCase): """StagingMetadata unit test stubs""" @@ -29,29 +26,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StagingMetadata: """Test StagingMetadata - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StagingMetadata` """ - model = lakefs_sdk.models.staging_metadata.StagingMetadata() # noqa: E501 - if include_optional : + model = StagingMetadata() + if include_optional: return StagingMetadata( staging = lakefs_sdk.models.staging_location.StagingLocation( physical_address = '', presigned_url = '', - presigned_url_expiry = 56, ), - checksum = '', - size_bytes = 56, + presigned_url_expiry = 56, ), + checksum = '', + size_bytes = 56, user_metadata = { 'key' : '' - }, - content_type = '', + }, + content_type = '', force = True ) - else : + else: return StagingMetadata( staging = lakefs_sdk.models.staging_location.StagingLocation( physical_address = '', diff --git a/clients/python/test/test_statement.py b/clients/python/test/test_statement.py index 89f3027398c..9f8904740c8 100644 --- a/clients/python/test/test_statement.py +++ b/clients/python/test/test_statement.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.statement import Statement # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.statement import Statement class TestStatement(unittest.TestCase): """Statement unit test stubs""" @@ -29,23 +26,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Statement: """Test Statement - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Statement` """ - model = lakefs_sdk.models.statement.Statement() # noqa: E501 - if include_optional : + model = Statement() + if include_optional: return Statement( - effect = 'allow', - resource = '', + effect = 'allow', + resource = '', action = [ '' ] ) - else : + else: return Statement( effect = 'allow', resource = '', diff --git a/clients/python/test/test_stats_event.py b/clients/python/test/test_stats_event.py index 42158d273a3..261f641a887 100644 --- a/clients/python/test/test_stats_event.py +++ b/clients/python/test/test_stats_event.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.stats_event import StatsEvent # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.stats_event import StatsEvent class TestStatsEvent(unittest.TestCase): """StatsEvent unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StatsEvent: """Test StatsEvent - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StatsEvent` """ - model = lakefs_sdk.models.stats_event.StatsEvent() # noqa: E501 - if include_optional : + model = StatsEvent() + if include_optional: return StatsEvent( - var_class = '', - name = '', + var_class = '', + name = '', count = 56 ) - else : + else: return StatsEvent( var_class = '', name = '', diff --git a/clients/python/test/test_stats_events_list.py b/clients/python/test/test_stats_events_list.py index a0f849da774..ace092b3893 100644 --- a/clients/python/test/test_stats_events_list.py +++ b/clients/python/test/test_stats_events_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.stats_events_list import StatsEventsList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.stats_events_list import StatsEventsList class TestStatsEventsList(unittest.TestCase): """StatsEventsList unit test stubs""" @@ -29,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StatsEventsList: """Test StatsEventsList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StatsEventsList` """ - model = lakefs_sdk.models.stats_events_list.StatsEventsList() # noqa: E501 - if include_optional : + model = StatsEventsList() + if include_optional: return StatsEventsList( events = [ lakefs_sdk.models.stats_event.StatsEvent( @@ -46,7 +43,7 @@ class = '', count = 56, ) ] ) - else : + else: return StatsEventsList( events = [ lakefs_sdk.models.stats_event.StatsEvent( diff --git a/clients/python/test/test_storage_config.py b/clients/python/test/test_storage_config.py index eb4230a0476..f79a5dd2623 100644 --- a/clients/python/test/test_storage_config.py +++ b/clients/python/test/test_storage_config.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.storage_config import StorageConfig # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.storage_config import StorageConfig class TestStorageConfig(unittest.TestCase): """StorageConfig unit test stubs""" @@ -29,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StorageConfig: """Test StorageConfig - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StorageConfig` """ - model = lakefs_sdk.models.storage_config.StorageConfig() # noqa: E501 - if include_optional : + model = StorageConfig() + if include_optional: return StorageConfig( - blockstore_type = '', - blockstore_namespace_example = '', - blockstore_namespace_validity_regex = '', - default_namespace_prefix = '', - pre_sign_support = True, - pre_sign_support_ui = True, - import_support = True, - import_validity_regex = '', + blockstore_type = '', + blockstore_namespace_example = '', + blockstore_namespace_validity_regex = '', + default_namespace_prefix = '', + pre_sign_support = True, + pre_sign_support_ui = True, + import_support = True, + import_validity_regex = '', pre_sign_multipart_upload = True ) - else : + else: return StorageConfig( blockstore_type = '', blockstore_namespace_example = '', diff --git a/clients/python/test/test_storage_uri.py b/clients/python/test/test_storage_uri.py index 4f82b771124..1434eb8172e 100644 --- a/clients/python/test/test_storage_uri.py +++ b/clients/python/test/test_storage_uri.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.storage_uri import StorageURI # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.storage_uri import StorageURI class TestStorageURI(unittest.TestCase): """StorageURI unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StorageURI: """Test StorageURI - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StorageURI` """ - model = lakefs_sdk.models.storage_uri.StorageURI() # noqa: E501 - if include_optional : + model = StorageURI() + if include_optional: return StorageURI( location = '' ) - else : + else: return StorageURI( location = '', ) diff --git a/clients/python/test/test_sts_auth_request.py b/clients/python/test/test_sts_auth_request.py index 3e2393357f7..af7574eaa3e 100644 --- a/clients/python/test/test_sts_auth_request.py +++ b/clients/python/test/test_sts_auth_request.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.sts_auth_request import StsAuthRequest # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.sts_auth_request import StsAuthRequest class TestStsAuthRequest(unittest.TestCase): """StsAuthRequest unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> StsAuthRequest: """Test StsAuthRequest - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `StsAuthRequest` """ - model = lakefs_sdk.models.sts_auth_request.StsAuthRequest() # noqa: E501 - if include_optional : + model = StsAuthRequest() + if include_optional: return StsAuthRequest( - code = '', - state = '', - redirect_uri = '', + code = '', + state = '', + redirect_uri = '', ttl_seconds = 56 ) - else : + else: return StsAuthRequest( code = '', state = '', diff --git a/clients/python/test/test_tag_creation.py b/clients/python/test/test_tag_creation.py index 98d50b21129..a26b53141c9 100644 --- a/clients/python/test/test_tag_creation.py +++ b/clients/python/test/test_tag_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.tag_creation import TagCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.tag_creation import TagCreation class TestTagCreation(unittest.TestCase): """TagCreation unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> TagCreation: """Test TagCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `TagCreation` """ - model = lakefs_sdk.models.tag_creation.TagCreation() # noqa: E501 - if include_optional : + model = TagCreation() + if include_optional: return TagCreation( - id = '', - ref = '', + id = '', + ref = '', force = True ) - else : + else: return TagCreation( id = '', ref = '', diff --git a/clients/python/test/test_tags_api.py b/clients/python/test/test_tags_api.py index 41f6286c01c..8f23ac2cf62 100644 --- a/clients/python/test/test_tags_api.py +++ b/clients/python/test/test_tags_api.py @@ -15,45 +15,43 @@ import unittest -import lakefs_sdk -from lakefs_sdk.api.tags_api import TagsApi # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.api.tags_api import TagsApi class TestTagsApi(unittest.TestCase): """TagsApi unit test stubs""" - def setUp(self): - self.api = lakefs_sdk.api.tags_api.TagsApi() # noqa: E501 + def setUp(self) -> None: + self.api = TagsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_create_tag(self): + def test_create_tag(self) -> None: """Test case for create_tag - create tag # noqa: E501 + create tag """ pass - def test_delete_tag(self): + def test_delete_tag(self) -> None: """Test case for delete_tag - delete tag # noqa: E501 + delete tag """ pass - def test_get_tag(self): + def test_get_tag(self) -> None: """Test case for get_tag - get tag # noqa: E501 + get tag """ pass - def test_list_tags(self): + def test_list_tags(self) -> None: """Test case for list_tags - list tags # noqa: E501 + list tags """ pass diff --git a/clients/python/test/test_task_info.py b/clients/python/test/test_task_info.py index 0f7202e6793..6d8eb3d1488 100644 --- a/clients/python/test/test_task_info.py +++ b/clients/python/test/test_task_info.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.task_info import TaskInfo # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.task_info import TaskInfo class TestTaskInfo(unittest.TestCase): """TaskInfo unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> TaskInfo: """Test TaskInfo - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `TaskInfo` """ - model = lakefs_sdk.models.task_info.TaskInfo() # noqa: E501 - if include_optional : + model = TaskInfo() + if include_optional: return TaskInfo( id = '' ) - else : + else: return TaskInfo( id = '', ) diff --git a/clients/python/test/test_underlying_object_properties.py b/clients/python/test/test_underlying_object_properties.py index 84ea9592f98..7608a6eba81 100644 --- a/clients/python/test/test_underlying_object_properties.py +++ b/clients/python/test/test_underlying_object_properties.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties class TestUnderlyingObjectProperties(unittest.TestCase): """UnderlyingObjectProperties unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UnderlyingObjectProperties: """Test UnderlyingObjectProperties - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `UnderlyingObjectProperties` """ - model = lakefs_sdk.models.underlying_object_properties.UnderlyingObjectProperties() # noqa: E501 - if include_optional : + model = UnderlyingObjectProperties() + if include_optional: return UnderlyingObjectProperties( storage_class = '' ) - else : + else: return UnderlyingObjectProperties( ) """ diff --git a/clients/python/test/test_update_token.py b/clients/python/test/test_update_token.py index 9898673d82c..f330d0a84c0 100644 --- a/clients/python/test/test_update_token.py +++ b/clients/python/test/test_update_token.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.update_token import UpdateToken # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.update_token import UpdateToken class TestUpdateToken(unittest.TestCase): """UpdateToken unit test stubs""" @@ -29,19 +26,19 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UpdateToken: """Test UpdateToken - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `UpdateToken` """ - model = lakefs_sdk.models.update_token.UpdateToken() # noqa: E501 - if include_optional : + model = UpdateToken() + if include_optional: return UpdateToken( staging_token = '' ) - else : + else: return UpdateToken( staging_token = '', ) diff --git a/clients/python/test/test_upload_part.py b/clients/python/test/test_upload_part.py index 161cd6fa6e6..6859f5b5ee7 100644 --- a/clients/python/test/test_upload_part.py +++ b/clients/python/test/test_upload_part.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.upload_part import UploadPart # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.upload_part import UploadPart class TestUploadPart(unittest.TestCase): """UploadPart unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UploadPart: """Test UploadPart - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `UploadPart` """ - model = lakefs_sdk.models.upload_part.UploadPart() # noqa: E501 - if include_optional : + model = UploadPart() + if include_optional: return UploadPart( - part_number = 56, + part_number = 56, etag = '' ) - else : + else: return UploadPart( part_number = 56, etag = '', diff --git a/clients/python/test/test_usage_report.py b/clients/python/test/test_usage_report.py index 8764e4c0f83..20921660500 100644 --- a/clients/python/test/test_usage_report.py +++ b/clients/python/test/test_usage_report.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.usage_report import UsageReport # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.usage_report import UsageReport class TestUsageReport(unittest.TestCase): """UsageReport unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UsageReport: """Test UsageReport - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `UsageReport` """ - model = lakefs_sdk.models.usage_report.UsageReport() # noqa: E501 - if include_optional : + model = UsageReport() + if include_optional: return UsageReport( - year = 56, - month = 56, + year = 56, + month = 56, count = 56 ) - else : + else: return UsageReport( year = 56, month = 56, diff --git a/clients/python/test/test_user.py b/clients/python/test/test_user.py index 357c1ef61cc..cb7ac75c4d1 100644 --- a/clients/python/test/test_user.py +++ b/clients/python/test/test_user.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.user import User # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.user import User class TestUser(unittest.TestCase): """User unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> User: """Test User - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `User` """ - model = lakefs_sdk.models.user.User() # noqa: E501 - if include_optional : + model = User() + if include_optional: return User( - id = '', - creation_date = 56, - friendly_name = '', + id = '', + creation_date = 56, + friendly_name = '', email = '' ) - else : + else: return User( id = '', creation_date = 56, diff --git a/clients/python/test/test_user_creation.py b/clients/python/test/test_user_creation.py index 19fe543d3e8..824b2315970 100644 --- a/clients/python/test/test_user_creation.py +++ b/clients/python/test/test_user_creation.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.user_creation import UserCreation # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.user_creation import UserCreation class TestUserCreation(unittest.TestCase): """UserCreation unit test stubs""" @@ -29,20 +26,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UserCreation: """Test UserCreation - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `UserCreation` """ - model = lakefs_sdk.models.user_creation.UserCreation() # noqa: E501 - if include_optional : + model = UserCreation() + if include_optional: return UserCreation( - id = '', + id = '', invite_user = True ) - else : + else: return UserCreation( id = '', ) diff --git a/clients/python/test/test_user_list.py b/clients/python/test/test_user_list.py index a7939e5bf84..00c2232c1e3 100644 --- a/clients/python/test/test_user_list.py +++ b/clients/python/test/test_user_list.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.user_list import UserList # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.user_list import UserList class TestUserList(unittest.TestCase): """UserList unit test stubs""" @@ -29,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> UserList: """Test UserList - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `UserList` """ - model = lakefs_sdk.models.user_list.UserList() # noqa: E501 - if include_optional : + model = UserList() + if include_optional: return UserList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, next_offset = '', results = 0, - max_per_page = 0, ), + max_per_page = 0, ), results = [ lakefs_sdk.models.user.User( id = '', @@ -52,7 +49,7 @@ def make_instance(self, include_optional): email = '', ) ] ) - else : + else: return UserList( pagination = lakefs_sdk.models.pagination.Pagination( has_more = True, diff --git a/clients/python/test/test_version_config.py b/clients/python/test/test_version_config.py index 88bea88b7fe..15a6deb9d43 100644 --- a/clients/python/test/test_version_config.py +++ b/clients/python/test/test_version_config.py @@ -14,11 +14,8 @@ import unittest -import datetime -import lakefs_sdk -from lakefs_sdk.models.version_config import VersionConfig # noqa: E501 -from lakefs_sdk.rest import ApiException +from lakefs_sdk.models.version_config import VersionConfig class TestVersionConfig(unittest.TestCase): """VersionConfig unit test stubs""" @@ -29,22 +26,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> VersionConfig: """Test VersionConfig - include_option is a boolean, when False only required + include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `VersionConfig` """ - model = lakefs_sdk.models.version_config.VersionConfig() # noqa: E501 - if include_optional : + model = VersionConfig() + if include_optional: return VersionConfig( - version = '', - latest_version = '', - upgrade_recommended = True, + version = '', + latest_version = '', + upgrade_recommended = True, upgrade_url = '' ) - else : + else: return VersionConfig( ) """ diff --git a/clients/rust/.openapi-generator/VERSION b/clients/rust/.openapi-generator/VERSION index 18bb4182dd0..09a6d30847d 100644 --- a/clients/rust/.openapi-generator/VERSION +++ b/clients/rust/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.8.0 diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index b0dd1bc3bc5..cabaabfc9a6 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -4,15 +4,13 @@ version = "0.1.0-SNAPSHOT" authors = ["services@treeverse.io"] description = "lakeFS HTTP API" license = "Apache 2.0" -edition = "2018" +edition = "2021" [dependencies] -serde = "^1.0" -serde_derive = "^1.0" -serde_with = "^2.0" +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" -url = "^2.2" -uuid = { version = "^1.0", features = ["serde", "v4"] } -[dependencies.reqwest] -version = "^0.11" -features = ["json", "multipart"] +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/clients/rust/README.md b/clients/rust/README.md index d83931b787a..02b4f56cdc5 100644 --- a/clients/rust/README.md +++ b/clients/rust/README.md @@ -9,7 +9,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat - API version: 1.0.0 - Package version: 0.1.0-SNAPSHOT -- Generator version: 7.5.0 +- Generator version: 7.8.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` ## Installation diff --git a/clients/rust/src/apis/actions_api.rs b/clients/rust/src/apis/actions_api.rs index 37b66b2b2d8..b53d4668170 100644 --- a/clients/rust/src/apis/actions_api.rs +++ b/clients/rust/src/apis/actions_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/auth_api.rs b/clients/rust/src/apis/auth_api.rs index 13731984d6b..e2cb275713c 100644 --- a/clients/rust/src/apis/auth_api.rs +++ b/clients/rust/src/apis/auth_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/branches_api.rs b/clients/rust/src/apis/branches_api.rs index a8f8364ee74..e3d1d52703d 100644 --- a/clients/rust/src/apis/branches_api.rs +++ b/clients/rust/src/apis/branches_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/commits_api.rs b/clients/rust/src/apis/commits_api.rs index ec8ec0e446c..b3c058dc970 100644 --- a/clients/rust/src/apis/commits_api.rs +++ b/clients/rust/src/apis/commits_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/config_api.rs b/clients/rust/src/apis/config_api.rs index 199c99958bd..91a0c93aa40 100644 --- a/clients/rust/src/apis/config_api.rs +++ b/clients/rust/src/apis/config_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/experimental_api.rs b/clients/rust/src/apis/experimental_api.rs index 02eac5b4088..3af091e1a55 100644 --- a/clients/rust/src/apis/experimental_api.rs +++ b/clients/rust/src/apis/experimental_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/external_api.rs b/clients/rust/src/apis/external_api.rs index 89d34928d55..48a4be05ccb 100644 --- a/clients/rust/src/apis/external_api.rs +++ b/clients/rust/src/apis/external_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/health_check_api.rs b/clients/rust/src/apis/health_check_api.rs index bd4b330546d..5108ba6f340 100644 --- a/clients/rust/src/apis/health_check_api.rs +++ b/clients/rust/src/apis/health_check_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/import_api.rs b/clients/rust/src/apis/import_api.rs index 70ab4f71da3..bd1280bbb18 100644 --- a/clients/rust/src/apis/import_api.rs +++ b/clients/rust/src/apis/import_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/internal_api.rs b/clients/rust/src/apis/internal_api.rs index 592a83afe76..c4e444f1286 100644 --- a/clients/rust/src/apis/internal_api.rs +++ b/clients/rust/src/apis/internal_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/metadata_api.rs b/clients/rust/src/apis/metadata_api.rs index 64c64eeff01..e8eb740947d 100644 --- a/clients/rust/src/apis/metadata_api.rs +++ b/clients/rust/src/apis/metadata_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/objects_api.rs b/clients/rust/src/apis/objects_api.rs index 2e63c3c18f3..53ad3ec6336 100644 --- a/clients/rust/src/apis/objects_api.rs +++ b/clients/rust/src/apis/objects_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/refs_api.rs b/clients/rust/src/apis/refs_api.rs index f093468199d..2169d3c87bc 100644 --- a/clients/rust/src/apis/refs_api.rs +++ b/clients/rust/src/apis/refs_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/repositories_api.rs b/clients/rust/src/apis/repositories_api.rs index 87217f1235c..f92f00ca46a 100644 --- a/clients/rust/src/apis/repositories_api.rs +++ b/clients/rust/src/apis/repositories_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/staging_api.rs b/clients/rust/src/apis/staging_api.rs index 441d4be8743..d55f6671855 100644 --- a/clients/rust/src/apis/staging_api.rs +++ b/clients/rust/src/apis/staging_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/apis/tags_api.rs b/clients/rust/src/apis/tags_api.rs index a9c34bc6173..d4046239263 100644 --- a/clients/rust/src/apis/tags_api.rs +++ b/clients/rust/src/apis/tags_api.rs @@ -10,7 +10,7 @@ use reqwest; - +use serde::{Deserialize, Serialize}; use crate::{apis::ResponseContent, models}; use super::{Error, configuration}; diff --git a/clients/rust/src/lib.rs b/clients/rust/src/lib.rs index 1ac114198fd..e1520628d76 100644 --- a/clients/rust/src/lib.rs +++ b/clients/rust/src/lib.rs @@ -1,8 +1,7 @@ #![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] -#[macro_use] -extern crate serde_derive; - +extern crate serde_repr; extern crate serde; extern crate serde_json; extern crate url; diff --git a/clients/rust/src/models/abort_presign_multipart_upload.rs b/clients/rust/src/models/abort_presign_multipart_upload.rs index 2f30142d71e..9d8ed661dc7 100644 --- a/clients/rust/src/models/abort_presign_multipart_upload.rs +++ b/clients/rust/src/models/abort_presign_multipart_upload.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AbortPresignMultipartUpload { diff --git a/clients/rust/src/models/access_key_credentials.rs b/clients/rust/src/models/access_key_credentials.rs index 43c929b032c..8ff180daa78 100644 --- a/clients/rust/src/models/access_key_credentials.rs +++ b/clients/rust/src/models/access_key_credentials.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessKeyCredentials { diff --git a/clients/rust/src/models/acl.rs b/clients/rust/src/models/acl.rs index 13eaa192113..c9f1b01eb18 100644 --- a/clients/rust/src/models/acl.rs +++ b/clients/rust/src/models/acl.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Acl { diff --git a/clients/rust/src/models/action_run.rs b/clients/rust/src/models/action_run.rs index 909144031be..ed432846416 100644 --- a/clients/rust/src/models/action_run.rs +++ b/clients/rust/src/models/action_run.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionRun { diff --git a/clients/rust/src/models/action_run_list.rs b/clients/rust/src/models/action_run_list.rs index 175717830fc..071964811d9 100644 --- a/clients/rust/src/models/action_run_list.rs +++ b/clients/rust/src/models/action_run_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ActionRunList { diff --git a/clients/rust/src/models/auth_capabilities.rs b/clients/rust/src/models/auth_capabilities.rs index b9a0e74a20d..96f3caae632 100644 --- a/clients/rust/src/models/auth_capabilities.rs +++ b/clients/rust/src/models/auth_capabilities.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthCapabilities { diff --git a/clients/rust/src/models/authentication_token.rs b/clients/rust/src/models/authentication_token.rs index dbe462fda6e..16574d10d6b 100644 --- a/clients/rust/src/models/authentication_token.rs +++ b/clients/rust/src/models/authentication_token.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthenticationToken { diff --git a/clients/rust/src/models/branch_creation.rs b/clients/rust/src/models/branch_creation.rs index 7a093ad0acf..51ab7b52de5 100644 --- a/clients/rust/src/models/branch_creation.rs +++ b/clients/rust/src/models/branch_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BranchCreation { diff --git a/clients/rust/src/models/branch_protection_rule.rs b/clients/rust/src/models/branch_protection_rule.rs index 1cd0b6ad117..4a32668187a 100644 --- a/clients/rust/src/models/branch_protection_rule.rs +++ b/clients/rust/src/models/branch_protection_rule.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BranchProtectionRule { diff --git a/clients/rust/src/models/cherry_pick_creation.rs b/clients/rust/src/models/cherry_pick_creation.rs index 86654137784..3c3437b0d5a 100644 --- a/clients/rust/src/models/cherry_pick_creation.rs +++ b/clients/rust/src/models/cherry_pick_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CherryPickCreation { diff --git a/clients/rust/src/models/comm_prefs_input.rs b/clients/rust/src/models/comm_prefs_input.rs index 88cdd7375a7..192335425f0 100644 --- a/clients/rust/src/models/comm_prefs_input.rs +++ b/clients/rust/src/models/comm_prefs_input.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CommPrefsInput { diff --git a/clients/rust/src/models/commit.rs b/clients/rust/src/models/commit.rs index 8fa682f61e2..950f2ac019a 100644 --- a/clients/rust/src/models/commit.rs +++ b/clients/rust/src/models/commit.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Commit { diff --git a/clients/rust/src/models/commit_creation.rs b/clients/rust/src/models/commit_creation.rs index 9a4b01db83c..d2fee11ea99 100644 --- a/clients/rust/src/models/commit_creation.rs +++ b/clients/rust/src/models/commit_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CommitCreation { diff --git a/clients/rust/src/models/commit_list.rs b/clients/rust/src/models/commit_list.rs index 64a20c0c2f8..d0122af4bc6 100644 --- a/clients/rust/src/models/commit_list.rs +++ b/clients/rust/src/models/commit_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CommitList { diff --git a/clients/rust/src/models/commit_overrides.rs b/clients/rust/src/models/commit_overrides.rs index f5064cadb42..7a55bdbd3c8 100644 --- a/clients/rust/src/models/commit_overrides.rs +++ b/clients/rust/src/models/commit_overrides.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CommitOverrides { diff --git a/clients/rust/src/models/commit_record_creation.rs b/clients/rust/src/models/commit_record_creation.rs index 9d334c57d80..8b364994a99 100644 --- a/clients/rust/src/models/commit_record_creation.rs +++ b/clients/rust/src/models/commit_record_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CommitRecordCreation { diff --git a/clients/rust/src/models/complete_presign_multipart_upload.rs b/clients/rust/src/models/complete_presign_multipart_upload.rs index 51c7021725a..2cc84a40f2c 100644 --- a/clients/rust/src/models/complete_presign_multipart_upload.rs +++ b/clients/rust/src/models/complete_presign_multipart_upload.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CompletePresignMultipartUpload { diff --git a/clients/rust/src/models/config.rs b/clients/rust/src/models/config.rs index 324bdde728f..3fe91f9d49f 100644 --- a/clients/rust/src/models/config.rs +++ b/clients/rust/src/models/config.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Config { diff --git a/clients/rust/src/models/credentials.rs b/clients/rust/src/models/credentials.rs index 8f0362a167b..e2a4a9cef16 100644 --- a/clients/rust/src/models/credentials.rs +++ b/clients/rust/src/models/credentials.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Credentials { diff --git a/clients/rust/src/models/credentials_list.rs b/clients/rust/src/models/credentials_list.rs index bdcc1f9deb0..a2895bc981e 100644 --- a/clients/rust/src/models/credentials_list.rs +++ b/clients/rust/src/models/credentials_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CredentialsList { diff --git a/clients/rust/src/models/credentials_with_secret.rs b/clients/rust/src/models/credentials_with_secret.rs index 551a480e03c..a6f6dc9fa51 100644 --- a/clients/rust/src/models/credentials_with_secret.rs +++ b/clients/rust/src/models/credentials_with_secret.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CredentialsWithSecret { diff --git a/clients/rust/src/models/current_user.rs b/clients/rust/src/models/current_user.rs index a973eb421ef..d28e4c3eb47 100644 --- a/clients/rust/src/models/current_user.rs +++ b/clients/rust/src/models/current_user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CurrentUser { diff --git a/clients/rust/src/models/diff.rs b/clients/rust/src/models/diff.rs index 6cee93ffae7..8df650bb020 100644 --- a/clients/rust/src/models/diff.rs +++ b/clients/rust/src/models/diff.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Diff { diff --git a/clients/rust/src/models/diff_list.rs b/clients/rust/src/models/diff_list.rs index eba58c21153..9eb53d632db 100644 --- a/clients/rust/src/models/diff_list.rs +++ b/clients/rust/src/models/diff_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct DiffList { diff --git a/clients/rust/src/models/error.rs b/clients/rust/src/models/error.rs index 60d7aa4adfe..50009dbcebb 100644 --- a/clients/rust/src/models/error.rs +++ b/clients/rust/src/models/error.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Error { diff --git a/clients/rust/src/models/error_no_acl.rs b/clients/rust/src/models/error_no_acl.rs index ecca147c59f..79c200bd4e1 100644 --- a/clients/rust/src/models/error_no_acl.rs +++ b/clients/rust/src/models/error_no_acl.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ErrorNoAcl { diff --git a/clients/rust/src/models/external_login_information.rs b/clients/rust/src/models/external_login_information.rs index e2174ce33df..45a220b4abf 100644 --- a/clients/rust/src/models/external_login_information.rs +++ b/clients/rust/src/models/external_login_information.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExternalLoginInformation { diff --git a/clients/rust/src/models/external_principal.rs b/clients/rust/src/models/external_principal.rs index 9ca7cf813ff..7b848c299fb 100644 --- a/clients/rust/src/models/external_principal.rs +++ b/clients/rust/src/models/external_principal.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExternalPrincipal { diff --git a/clients/rust/src/models/external_principal_creation.rs b/clients/rust/src/models/external_principal_creation.rs index 647d0a9bb16..2ccadd12255 100644 --- a/clients/rust/src/models/external_principal_creation.rs +++ b/clients/rust/src/models/external_principal_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExternalPrincipalCreation { diff --git a/clients/rust/src/models/external_principal_list.rs b/clients/rust/src/models/external_principal_list.rs index a48e3bb1e37..83e13764e84 100644 --- a/clients/rust/src/models/external_principal_list.rs +++ b/clients/rust/src/models/external_principal_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExternalPrincipalList { diff --git a/clients/rust/src/models/find_merge_base_result.rs b/clients/rust/src/models/find_merge_base_result.rs index ae72ef3aec0..b0fbc408575 100644 --- a/clients/rust/src/models/find_merge_base_result.rs +++ b/clients/rust/src/models/find_merge_base_result.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FindMergeBaseResult { diff --git a/clients/rust/src/models/garbage_collection_config.rs b/clients/rust/src/models/garbage_collection_config.rs index aa21811a1a5..7d98c90cc2f 100644 --- a/clients/rust/src/models/garbage_collection_config.rs +++ b/clients/rust/src/models/garbage_collection_config.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct GarbageCollectionConfig { diff --git a/clients/rust/src/models/garbage_collection_prepare_response.rs b/clients/rust/src/models/garbage_collection_prepare_response.rs index ffb37806740..d5a47f47355 100644 --- a/clients/rust/src/models/garbage_collection_prepare_response.rs +++ b/clients/rust/src/models/garbage_collection_prepare_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct GarbageCollectionPrepareResponse { diff --git a/clients/rust/src/models/garbage_collection_rule.rs b/clients/rust/src/models/garbage_collection_rule.rs index 06c15728f41..7fbbd200582 100644 --- a/clients/rust/src/models/garbage_collection_rule.rs +++ b/clients/rust/src/models/garbage_collection_rule.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct GarbageCollectionRule { diff --git a/clients/rust/src/models/garbage_collection_rules.rs b/clients/rust/src/models/garbage_collection_rules.rs index ac8a4746e6b..ad300bfac4b 100644 --- a/clients/rust/src/models/garbage_collection_rules.rs +++ b/clients/rust/src/models/garbage_collection_rules.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct GarbageCollectionRules { diff --git a/clients/rust/src/models/group.rs b/clients/rust/src/models/group.rs index 49522cbd8f5..649df128a6a 100644 --- a/clients/rust/src/models/group.rs +++ b/clients/rust/src/models/group.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Group { diff --git a/clients/rust/src/models/group_creation.rs b/clients/rust/src/models/group_creation.rs index 5586a8e97d1..691f4aa9c09 100644 --- a/clients/rust/src/models/group_creation.rs +++ b/clients/rust/src/models/group_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupCreation { diff --git a/clients/rust/src/models/group_list.rs b/clients/rust/src/models/group_list.rs index c7442e6a545..043c70bef49 100644 --- a/clients/rust/src/models/group_list.rs +++ b/clients/rust/src/models/group_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupList { diff --git a/clients/rust/src/models/hook_run.rs b/clients/rust/src/models/hook_run.rs index 937678fb8e2..205d465c51d 100644 --- a/clients/rust/src/models/hook_run.rs +++ b/clients/rust/src/models/hook_run.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct HookRun { diff --git a/clients/rust/src/models/hook_run_list.rs b/clients/rust/src/models/hook_run_list.rs index d8cfbfafc8d..7308744a774 100644 --- a/clients/rust/src/models/hook_run_list.rs +++ b/clients/rust/src/models/hook_run_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct HookRunList { diff --git a/clients/rust/src/models/import_creation.rs b/clients/rust/src/models/import_creation.rs index e5101de3e93..ad9c220ece9 100644 --- a/clients/rust/src/models/import_creation.rs +++ b/clients/rust/src/models/import_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportCreation { diff --git a/clients/rust/src/models/import_creation_response.rs b/clients/rust/src/models/import_creation_response.rs index bfa8c0a06ee..00cb48a9c31 100644 --- a/clients/rust/src/models/import_creation_response.rs +++ b/clients/rust/src/models/import_creation_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportCreationResponse { diff --git a/clients/rust/src/models/import_location.rs b/clients/rust/src/models/import_location.rs index 14829652100..01be2ea4ebe 100644 --- a/clients/rust/src/models/import_location.rs +++ b/clients/rust/src/models/import_location.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportLocation { diff --git a/clients/rust/src/models/import_status.rs b/clients/rust/src/models/import_status.rs index e86e750b7e6..a7735b7b29a 100644 --- a/clients/rust/src/models/import_status.rs +++ b/clients/rust/src/models/import_status.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportStatus { diff --git a/clients/rust/src/models/installation_usage_report.rs b/clients/rust/src/models/installation_usage_report.rs index 7aeb535a1a5..75c91d2a53a 100644 --- a/clients/rust/src/models/installation_usage_report.rs +++ b/clients/rust/src/models/installation_usage_report.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct InstallationUsageReport { diff --git a/clients/rust/src/models/internal_delete_branch_protection_rule_request.rs b/clients/rust/src/models/internal_delete_branch_protection_rule_request.rs index 1dbf0ce7b90..3d659393947 100644 --- a/clients/rust/src/models/internal_delete_branch_protection_rule_request.rs +++ b/clients/rust/src/models/internal_delete_branch_protection_rule_request.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct InternalDeleteBranchProtectionRuleRequest { diff --git a/clients/rust/src/models/login_config.rs b/clients/rust/src/models/login_config.rs index 7f052d5cf82..b438326bf07 100644 --- a/clients/rust/src/models/login_config.rs +++ b/clients/rust/src/models/login_config.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LoginConfig { diff --git a/clients/rust/src/models/login_information.rs b/clients/rust/src/models/login_information.rs index 8148894f1b0..a42a4e1b1ec 100644 --- a/clients/rust/src/models/login_information.rs +++ b/clients/rust/src/models/login_information.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct LoginInformation { diff --git a/clients/rust/src/models/merge.rs b/clients/rust/src/models/merge.rs index 8dedae1f09b..2b109cac8b3 100644 --- a/clients/rust/src/models/merge.rs +++ b/clients/rust/src/models/merge.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Merge { diff --git a/clients/rust/src/models/merge_result.rs b/clients/rust/src/models/merge_result.rs index 2cf9a964412..d0c9e6d0188 100644 --- a/clients/rust/src/models/merge_result.rs +++ b/clients/rust/src/models/merge_result.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MergeResult { diff --git a/clients/rust/src/models/meta_range_creation.rs b/clients/rust/src/models/meta_range_creation.rs index a7ad858b34a..c08fa410568 100644 --- a/clients/rust/src/models/meta_range_creation.rs +++ b/clients/rust/src/models/meta_range_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MetaRangeCreation { diff --git a/clients/rust/src/models/meta_range_creation_response.rs b/clients/rust/src/models/meta_range_creation_response.rs index 49eb09d7196..10ca7c18551 100644 --- a/clients/rust/src/models/meta_range_creation_response.rs +++ b/clients/rust/src/models/meta_range_creation_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MetaRangeCreationResponse { diff --git a/clients/rust/src/models/model_ref.rs b/clients/rust/src/models/model_ref.rs index 591e3e687ae..9b4b50b77cc 100644 --- a/clients/rust/src/models/model_ref.rs +++ b/clients/rust/src/models/model_ref.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Ref { diff --git a/clients/rust/src/models/object_copy_creation.rs b/clients/rust/src/models/object_copy_creation.rs index 34ab5896b35..b767f93b66d 100644 --- a/clients/rust/src/models/object_copy_creation.rs +++ b/clients/rust/src/models/object_copy_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjectCopyCreation { diff --git a/clients/rust/src/models/object_error.rs b/clients/rust/src/models/object_error.rs index 8e5302a27e2..6ad2baf5fe4 100644 --- a/clients/rust/src/models/object_error.rs +++ b/clients/rust/src/models/object_error.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjectError { diff --git a/clients/rust/src/models/object_error_list.rs b/clients/rust/src/models/object_error_list.rs index 6efcd17f50c..11397954f2c 100644 --- a/clients/rust/src/models/object_error_list.rs +++ b/clients/rust/src/models/object_error_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjectErrorList { diff --git a/clients/rust/src/models/object_stage_creation.rs b/clients/rust/src/models/object_stage_creation.rs index 63dea5cd354..b468ac393dd 100644 --- a/clients/rust/src/models/object_stage_creation.rs +++ b/clients/rust/src/models/object_stage_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjectStageCreation { diff --git a/clients/rust/src/models/object_stats.rs b/clients/rust/src/models/object_stats.rs index 377cdf57aa9..3e595027e53 100644 --- a/clients/rust/src/models/object_stats.rs +++ b/clients/rust/src/models/object_stats.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjectStats { diff --git a/clients/rust/src/models/object_stats_list.rs b/clients/rust/src/models/object_stats_list.rs index 4cfcdca914c..5ca6b8ce76d 100644 --- a/clients/rust/src/models/object_stats_list.rs +++ b/clients/rust/src/models/object_stats_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ObjectStatsList { diff --git a/clients/rust/src/models/pagination.rs b/clients/rust/src/models/pagination.rs index c43dc168372..9c3b33bec75 100644 --- a/clients/rust/src/models/pagination.rs +++ b/clients/rust/src/models/pagination.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pagination { diff --git a/clients/rust/src/models/path_list.rs b/clients/rust/src/models/path_list.rs index 04c6a2a4531..b1d72c8d233 100644 --- a/clients/rust/src/models/path_list.rs +++ b/clients/rust/src/models/path_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PathList { diff --git a/clients/rust/src/models/policy.rs b/clients/rust/src/models/policy.rs index ad724e86ff0..346191e66a1 100644 --- a/clients/rust/src/models/policy.rs +++ b/clients/rust/src/models/policy.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Policy { diff --git a/clients/rust/src/models/policy_list.rs b/clients/rust/src/models/policy_list.rs index b4fac8fb376..549d14dc62d 100644 --- a/clients/rust/src/models/policy_list.rs +++ b/clients/rust/src/models/policy_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyList { diff --git a/clients/rust/src/models/prepare_gc_uncommitted_request.rs b/clients/rust/src/models/prepare_gc_uncommitted_request.rs index d450d9e1e1e..3980ec101f3 100644 --- a/clients/rust/src/models/prepare_gc_uncommitted_request.rs +++ b/clients/rust/src/models/prepare_gc_uncommitted_request.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PrepareGcUncommittedRequest { diff --git a/clients/rust/src/models/prepare_gc_uncommitted_response.rs b/clients/rust/src/models/prepare_gc_uncommitted_response.rs index 877860d3250..88314e2e129 100644 --- a/clients/rust/src/models/prepare_gc_uncommitted_response.rs +++ b/clients/rust/src/models/prepare_gc_uncommitted_response.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PrepareGcUncommittedResponse { diff --git a/clients/rust/src/models/presign_multipart_upload.rs b/clients/rust/src/models/presign_multipart_upload.rs index ce199bace15..e3989092e39 100644 --- a/clients/rust/src/models/presign_multipart_upload.rs +++ b/clients/rust/src/models/presign_multipart_upload.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PresignMultipartUpload { diff --git a/clients/rust/src/models/range_metadata.rs b/clients/rust/src/models/range_metadata.rs index 99895bd2c04..7d4b4de927e 100644 --- a/clients/rust/src/models/range_metadata.rs +++ b/clients/rust/src/models/range_metadata.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RangeMetadata { diff --git a/clients/rust/src/models/ref_list.rs b/clients/rust/src/models/ref_list.rs index 9d6c97540da..f37b5a77967 100644 --- a/clients/rust/src/models/ref_list.rs +++ b/clients/rust/src/models/ref_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RefList { diff --git a/clients/rust/src/models/refs_dump.rs b/clients/rust/src/models/refs_dump.rs index c17a7fd0b62..cb6e449b98c 100644 --- a/clients/rust/src/models/refs_dump.rs +++ b/clients/rust/src/models/refs_dump.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RefsDump { diff --git a/clients/rust/src/models/refs_restore.rs b/clients/rust/src/models/refs_restore.rs index 87276a33f3f..168039b8259 100644 --- a/clients/rust/src/models/refs_restore.rs +++ b/clients/rust/src/models/refs_restore.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RefsRestore { diff --git a/clients/rust/src/models/repository.rs b/clients/rust/src/models/repository.rs index 0c1eb05c539..9a0830434ee 100644 --- a/clients/rust/src/models/repository.rs +++ b/clients/rust/src/models/repository.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Repository { diff --git a/clients/rust/src/models/repository_creation.rs b/clients/rust/src/models/repository_creation.rs index fe5b8286445..ea337355a69 100644 --- a/clients/rust/src/models/repository_creation.rs +++ b/clients/rust/src/models/repository_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RepositoryCreation { diff --git a/clients/rust/src/models/repository_dump_status.rs b/clients/rust/src/models/repository_dump_status.rs index 7fae7ef1467..a5c1c674de5 100644 --- a/clients/rust/src/models/repository_dump_status.rs +++ b/clients/rust/src/models/repository_dump_status.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RepositoryDumpStatus { diff --git a/clients/rust/src/models/repository_list.rs b/clients/rust/src/models/repository_list.rs index 94b1c227fb1..b1e64af9336 100644 --- a/clients/rust/src/models/repository_list.rs +++ b/clients/rust/src/models/repository_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RepositoryList { diff --git a/clients/rust/src/models/repository_metadata_keys.rs b/clients/rust/src/models/repository_metadata_keys.rs index db379c15cf5..62a6b530403 100644 --- a/clients/rust/src/models/repository_metadata_keys.rs +++ b/clients/rust/src/models/repository_metadata_keys.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RepositoryMetadataKeys { diff --git a/clients/rust/src/models/repository_metadata_set.rs b/clients/rust/src/models/repository_metadata_set.rs index bc92f13759f..9d07989fa63 100644 --- a/clients/rust/src/models/repository_metadata_set.rs +++ b/clients/rust/src/models/repository_metadata_set.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RepositoryMetadataSet { diff --git a/clients/rust/src/models/repository_restore_status.rs b/clients/rust/src/models/repository_restore_status.rs index 4019e95d266..20d58566739 100644 --- a/clients/rust/src/models/repository_restore_status.rs +++ b/clients/rust/src/models/repository_restore_status.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RepositoryRestoreStatus { diff --git a/clients/rust/src/models/reset_creation.rs b/clients/rust/src/models/reset_creation.rs index f4effdfe14a..a90fcfb96b7 100644 --- a/clients/rust/src/models/reset_creation.rs +++ b/clients/rust/src/models/reset_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ResetCreation { diff --git a/clients/rust/src/models/revert_creation.rs b/clients/rust/src/models/revert_creation.rs index 03f1b462cdd..73d8a256e9a 100644 --- a/clients/rust/src/models/revert_creation.rs +++ b/clients/rust/src/models/revert_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RevertCreation { diff --git a/clients/rust/src/models/setup.rs b/clients/rust/src/models/setup.rs index 48e0b90b328..a0ce94f916c 100644 --- a/clients/rust/src/models/setup.rs +++ b/clients/rust/src/models/setup.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Setup { diff --git a/clients/rust/src/models/setup_state.rs b/clients/rust/src/models/setup_state.rs index a583a18f21d..79636b593e2 100644 --- a/clients/rust/src/models/setup_state.rs +++ b/clients/rust/src/models/setup_state.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct SetupState { diff --git a/clients/rust/src/models/staging_location.rs b/clients/rust/src/models/staging_location.rs index 2537397aef7..243da2d04be 100644 --- a/clients/rust/src/models/staging_location.rs +++ b/clients/rust/src/models/staging_location.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// StagingLocation : location for placing an object when staging it #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/clients/rust/src/models/staging_metadata.rs b/clients/rust/src/models/staging_metadata.rs index 76f58e74c67..5c3a4adf140 100644 --- a/clients/rust/src/models/staging_metadata.rs +++ b/clients/rust/src/models/staging_metadata.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// StagingMetadata : information about uploaded object #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/clients/rust/src/models/statement.rs b/clients/rust/src/models/statement.rs index abc8c8f6d5b..8d515515d54 100644 --- a/clients/rust/src/models/statement.rs +++ b/clients/rust/src/models/statement.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Statement { diff --git a/clients/rust/src/models/stats_event.rs b/clients/rust/src/models/stats_event.rs index 9aef7219183..901ce5b26ea 100644 --- a/clients/rust/src/models/stats_event.rs +++ b/clients/rust/src/models/stats_event.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StatsEvent { diff --git a/clients/rust/src/models/stats_events_list.rs b/clients/rust/src/models/stats_events_list.rs index 1d769ba442b..6d2876eb1cc 100644 --- a/clients/rust/src/models/stats_events_list.rs +++ b/clients/rust/src/models/stats_events_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StatsEventsList { diff --git a/clients/rust/src/models/storage_config.rs b/clients/rust/src/models/storage_config.rs index 5060d55c11c..9fddfaf3d12 100644 --- a/clients/rust/src/models/storage_config.rs +++ b/clients/rust/src/models/storage_config.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StorageConfig { diff --git a/clients/rust/src/models/storage_uri.rs b/clients/rust/src/models/storage_uri.rs index 1cd8e9459c9..a3097b2c29b 100644 --- a/clients/rust/src/models/storage_uri.rs +++ b/clients/rust/src/models/storage_uri.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// StorageUri : URI to a path in a storage provider (e.g. \"s3://bucket1/path/to/object\") #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/clients/rust/src/models/sts_auth_request.rs b/clients/rust/src/models/sts_auth_request.rs index 715a7a509fb..5f80dec4a9a 100644 --- a/clients/rust/src/models/sts_auth_request.rs +++ b/clients/rust/src/models/sts_auth_request.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StsAuthRequest { diff --git a/clients/rust/src/models/tag_creation.rs b/clients/rust/src/models/tag_creation.rs index 96a98498953..f2066c219e6 100644 --- a/clients/rust/src/models/tag_creation.rs +++ b/clients/rust/src/models/tag_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; /// TagCreation : Make tag ID point at this REF. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] diff --git a/clients/rust/src/models/task_info.rs b/clients/rust/src/models/task_info.rs index 0467930bfad..4b8565b1f11 100644 --- a/clients/rust/src/models/task_info.rs +++ b/clients/rust/src/models/task_info.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TaskInfo { diff --git a/clients/rust/src/models/underlying_object_properties.rs b/clients/rust/src/models/underlying_object_properties.rs index b0a05ee1f1b..75a532034ad 100644 --- a/clients/rust/src/models/underlying_object_properties.rs +++ b/clients/rust/src/models/underlying_object_properties.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UnderlyingObjectProperties { diff --git a/clients/rust/src/models/update_token.rs b/clients/rust/src/models/update_token.rs index 0ffbdd066e3..b8da8101c14 100644 --- a/clients/rust/src/models/update_token.rs +++ b/clients/rust/src/models/update_token.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateToken { diff --git a/clients/rust/src/models/upload_part.rs b/clients/rust/src/models/upload_part.rs index 05c58cabe09..a712ea1e6e8 100644 --- a/clients/rust/src/models/upload_part.rs +++ b/clients/rust/src/models/upload_part.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UploadPart { diff --git a/clients/rust/src/models/usage_report.rs b/clients/rust/src/models/usage_report.rs index 695b8e306d1..3ef2acc8660 100644 --- a/clients/rust/src/models/usage_report.rs +++ b/clients/rust/src/models/usage_report.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UsageReport { diff --git a/clients/rust/src/models/user.rs b/clients/rust/src/models/user.rs index 06341cbd9d8..822ad626136 100644 --- a/clients/rust/src/models/user.rs +++ b/clients/rust/src/models/user.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct User { diff --git a/clients/rust/src/models/user_creation.rs b/clients/rust/src/models/user_creation.rs index 516b967f814..4960d4bafd6 100644 --- a/clients/rust/src/models/user_creation.rs +++ b/clients/rust/src/models/user_creation.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UserCreation { diff --git a/clients/rust/src/models/user_list.rs b/clients/rust/src/models/user_list.rs index 3725bdead88..3bb3e687a08 100644 --- a/clients/rust/src/models/user_list.rs +++ b/clients/rust/src/models/user_list.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UserList { diff --git a/clients/rust/src/models/version_config.rs b/clients/rust/src/models/version_config.rs index e3c64b6e630..de315f34f42 100644 --- a/clients/rust/src/models/version_config.rs +++ b/clients/rust/src/models/version_config.rs @@ -9,6 +9,7 @@ */ use crate::models; +use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct VersionConfig {