phasetwo-sdk 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phasetwo/__init__.py +19 -0
- phasetwo/openapi/__init__.py +244 -0
- phasetwo/openapi/api/__init__.py +13 -0
- phasetwo/openapi/api/attributes_api.py +1336 -0
- phasetwo/openapi/api/events_api.py +3507 -0
- phasetwo/openapi/api/identity_providers_api.py +3922 -0
- phasetwo/openapi/api/organization_domains_api.py +828 -0
- phasetwo/openapi/api/organization_invitations_api.py +1684 -0
- phasetwo/openapi/api/organization_memberships_api.py +2030 -0
- phasetwo/openapi/api/organization_roles_api.py +3067 -0
- phasetwo/openapi/api/organization_scim_api.py +1141 -0
- phasetwo/openapi/api/organizations_api.py +4212 -0
- phasetwo/openapi/api/users_api.py +1963 -0
- phasetwo/openapi/api_client.py +858 -0
- phasetwo/openapi/api_response.py +20 -0
- phasetwo/openapi/configuration.py +683 -0
- phasetwo/openapi/exceptions.py +220 -0
- phasetwo/openapi/models/__init__.py +109 -0
- phasetwo/openapi/models/access_token_response.py +115 -0
- phasetwo/openapi/models/auth_details_representation.py +104 -0
- phasetwo/openapi/models/bulk_response_item.py +91 -0
- phasetwo/openapi/models/credential_representation.py +84 -0
- phasetwo/openapi/models/event_representation.py +138 -0
- phasetwo/openapi/models/external_basic_scim_auth.py +103 -0
- phasetwo/openapi/models/external_jwt_scim_auth.py +108 -0
- phasetwo/openapi/models/external_secret_scim_auth.py +96 -0
- phasetwo/openapi/models/identity_provider_mapper_representation.py +105 -0
- phasetwo/openapi/models/identity_provider_representation.py +128 -0
- phasetwo/openapi/models/idp_initiated_client_representation.py +122 -0
- phasetwo/openapi/models/idp_initiated_client_representation_attributes.py +141 -0
- phasetwo/openapi/models/invitation_representation.py +110 -0
- phasetwo/openapi/models/invitation_request_representation.py +104 -0
- phasetwo/openapi/models/keycloak_scim_auth.py +90 -0
- phasetwo/openapi/models/link_identity_provider_representation.py +91 -0
- phasetwo/openapi/models/magic_link_request.py +137 -0
- phasetwo/openapi/models/magic_link_response.py +91 -0
- phasetwo/openapi/models/my_organization_representation.py +101 -0
- phasetwo/openapi/models/organization_config_representation.py +140 -0
- phasetwo/openapi/models/organization_domain_representation.py +98 -0
- phasetwo/openapi/models/organization_export_representation.py +168 -0
- phasetwo/openapi/models/organization_export_representation_all_of_members.py +91 -0
- phasetwo/openapi/models/organization_member_attribute_representation.py +83 -0
- phasetwo/openapi/models/organization_representation.py +107 -0
- phasetwo/openapi/models/organization_role_representation.py +91 -0
- phasetwo/openapi/models/organization_scim_auth.py +227 -0
- phasetwo/openapi/models/organization_scim_representation.py +113 -0
- phasetwo/openapi/models/organizations_config_representation.py +97 -0
- phasetwo/openapi/models/organizations_export_representation.py +132 -0
- phasetwo/openapi/models/organizations_import_representation.py +119 -0
- phasetwo/openapi/models/organizations_import_result_representation.py +115 -0
- phasetwo/openapi/models/organizations_import_result_representation_errors_inner.py +88 -0
- phasetwo/openapi/models/portal_link_representation.py +91 -0
- phasetwo/openapi/models/realm_attribute_representation.py +91 -0
- phasetwo/openapi/models/switch_organization_representation.py +83 -0
- phasetwo/openapi/models/user_brief_representation.py +115 -0
- phasetwo/openapi/models/user_representation.py +118 -0
- phasetwo/openapi/models/user_with_orgs_brief_representation.py +143 -0
- phasetwo/openapi/models/user_with_orgs_representation.py +146 -0
- phasetwo/openapi/models/webhook_representation.py +113 -0
- phasetwo/openapi/models/webhook_send_representation.py +125 -0
- phasetwo/openapi/py.typed +0 -0
- phasetwo/openapi/rest.py +323 -0
- phasetwo/py.typed +0 -0
- phasetwo_sdk-0.2.0.dist-info/METADATA +109 -0
- phasetwo_sdk-0.2.0.dist-info/RECORD +67 -0
- phasetwo_sdk-0.2.0.dist-info/WHEEL +4 -0
- phasetwo_sdk-0.2.0.dist-info/licenses/COPYING +202 -0
phasetwo/__init__.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Python client for the Phase Two Admin REST API.
|
|
2
|
+
|
|
3
|
+
The API classes and models are generated into ``phasetwo.openapi`` by
|
|
4
|
+
https://github.com/p2-inc/phasetwo-sdk-generator and re-exported here, so
|
|
5
|
+
``from phasetwo import OrganizationsApi`` works. Hand-written helpers live next to
|
|
6
|
+
this file; never edit ``phasetwo/openapi`` by hand.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from importlib.metadata import PackageNotFoundError, version as _version
|
|
10
|
+
|
|
11
|
+
from phasetwo.openapi import * # noqa: F401,F403
|
|
12
|
+
from phasetwo.openapi import __all__ as _generated_all
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
__version__ = _version("phasetwo-sdk")
|
|
16
|
+
except PackageNotFoundError: # running from a source checkout
|
|
17
|
+
__version__ = "0.0.0"
|
|
18
|
+
|
|
19
|
+
__all__ = list(_generated_all)
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Phase Two Admin REST API
|
|
7
|
+
|
|
8
|
+
This is a REST API reference for the Phase Two Keycloak extensions. These are extensions to the standard [Keycloak Admin REST API](https://www.keycloak.org/docs-api/latest/rest-api/index.html), and run on your cluster alongside it. ### Base URI format Paths specified in the documentation are relative to the base URI. - Format: `https://<your-cluster-host>/auth/realms` - Example: `https://auth.example.com/auth/realms` `<your-cluster-host>` is your cluster's hostname from the Phase Two Dashboard, or a custom domain attached to it. ### Authentication Send an access token in the `Authorization: Bearer <token>` header of every request. We recommend getting the token for a [service account](https://phasetwo.io/docs/api/service-accounts) with the client credentials grant, using a confidential client you create for API access. A Keycloak admin client library, such as the [Keycloak Admin Client for JavaScript](https://github.com/keycloak/keycloak/tree/main/js/libs/keycloak-admin-client), can take care of getting an access token and refreshing it when it expires. #### Client credentials grant example ``` POST /auth/realms/my-realm/protocol/openid-connect/token Host: auth.example.com Accept: application/json Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=api-client&client_secret=<client-secret> ``` The response contains the access token, its type, and its lifetime in seconds: ```json { \"access_token\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\", \"token_type\": \"Bearer\", \"expires_in\": 300 } ``` ### SDKs Modern API libraries are available for several common languages. These are available as open source at the links below, or you can choose to generate your own using our [OpenAPI spec file](https://raw.githubusercontent.com/p2-inc/phasetwo-docs/main/openapi.yaml). | Language | Library | | --- | --- | | Java (and other JVM langs) | https://github.com/p2-inc/phasetwo-java | | JavaScript/TypeScript | https://github.com/p2-inc/phasetwo-js | | Python | https://github.com/p2-inc/phasetwo-python |
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: see sdk-generator.json
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501
|
|
15
|
+
|
|
16
|
+
__version__ = "1.0.0"
|
|
17
|
+
|
|
18
|
+
# Define package exports
|
|
19
|
+
__all__ = [
|
|
20
|
+
"AttributesApi",
|
|
21
|
+
"EventsApi",
|
|
22
|
+
"IdentityProvidersApi",
|
|
23
|
+
"OrganizationDomainsApi",
|
|
24
|
+
"OrganizationInvitationsApi",
|
|
25
|
+
"OrganizationMembershipsApi",
|
|
26
|
+
"OrganizationRolesApi",
|
|
27
|
+
"OrganizationSCIMApi",
|
|
28
|
+
"OrganizationsApi",
|
|
29
|
+
"UsersApi",
|
|
30
|
+
"ApiResponse",
|
|
31
|
+
"ApiClient",
|
|
32
|
+
"Configuration",
|
|
33
|
+
"OpenApiException",
|
|
34
|
+
"ApiTypeError",
|
|
35
|
+
"ApiValueError",
|
|
36
|
+
"ApiKeyError",
|
|
37
|
+
"ApiAttributeError",
|
|
38
|
+
"ApiException",
|
|
39
|
+
"AccessTokenResponse",
|
|
40
|
+
"AuthDetailsRepresentation",
|
|
41
|
+
"BulkResponseItem",
|
|
42
|
+
"CredentialRepresentation",
|
|
43
|
+
"EventRepresentation",
|
|
44
|
+
"ExternalBasicScimAuth",
|
|
45
|
+
"ExternalJwtScimAuth",
|
|
46
|
+
"ExternalSecretScimAuth",
|
|
47
|
+
"IdentityProviderMapperRepresentation",
|
|
48
|
+
"IdentityProviderRepresentation",
|
|
49
|
+
"IdpInitiatedClientRepresentation",
|
|
50
|
+
"IdpInitiatedClientRepresentationAttributes",
|
|
51
|
+
"InvitationRepresentation",
|
|
52
|
+
"InvitationRequestRepresentation",
|
|
53
|
+
"KeycloakScimAuth",
|
|
54
|
+
"LinkIdentityProviderRepresentation",
|
|
55
|
+
"MagicLinkRequest",
|
|
56
|
+
"MagicLinkResponse",
|
|
57
|
+
"MyOrganizationRepresentation",
|
|
58
|
+
"OrganizationConfigRepresentation",
|
|
59
|
+
"OrganizationDomainRepresentation",
|
|
60
|
+
"OrganizationExportRepresentation",
|
|
61
|
+
"OrganizationExportRepresentationAllOfMembers",
|
|
62
|
+
"OrganizationMemberAttributeRepresentation",
|
|
63
|
+
"OrganizationRepresentation",
|
|
64
|
+
"OrganizationRoleRepresentation",
|
|
65
|
+
"OrganizationScimAuth",
|
|
66
|
+
"OrganizationScimRepresentation",
|
|
67
|
+
"OrganizationsConfigRepresentation",
|
|
68
|
+
"OrganizationsExportRepresentation",
|
|
69
|
+
"OrganizationsImportRepresentation",
|
|
70
|
+
"OrganizationsImportResultRepresentation",
|
|
71
|
+
"OrganizationsImportResultRepresentationErrorsInner",
|
|
72
|
+
"PortalLinkRepresentation",
|
|
73
|
+
"RealmAttributeRepresentation",
|
|
74
|
+
"SwitchOrganizationRepresentation",
|
|
75
|
+
"UserBriefRepresentation",
|
|
76
|
+
"UserRepresentation",
|
|
77
|
+
"UserWithOrgsBriefRepresentation",
|
|
78
|
+
"UserWithOrgsRepresentation",
|
|
79
|
+
"WebhookRepresentation",
|
|
80
|
+
"WebhookSendRepresentation",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
# import apis into sdk package
|
|
84
|
+
from phasetwo.openapi.api.attributes_api import AttributesApi as AttributesApi
|
|
85
|
+
from phasetwo.openapi.api.events_api import EventsApi as EventsApi
|
|
86
|
+
from phasetwo.openapi.api.identity_providers_api import (
|
|
87
|
+
IdentityProvidersApi as IdentityProvidersApi,
|
|
88
|
+
)
|
|
89
|
+
from phasetwo.openapi.api.organization_domains_api import (
|
|
90
|
+
OrganizationDomainsApi as OrganizationDomainsApi,
|
|
91
|
+
)
|
|
92
|
+
from phasetwo.openapi.api.organization_invitations_api import (
|
|
93
|
+
OrganizationInvitationsApi as OrganizationInvitationsApi,
|
|
94
|
+
)
|
|
95
|
+
from phasetwo.openapi.api.organization_memberships_api import (
|
|
96
|
+
OrganizationMembershipsApi as OrganizationMembershipsApi,
|
|
97
|
+
)
|
|
98
|
+
from phasetwo.openapi.api.organization_roles_api import (
|
|
99
|
+
OrganizationRolesApi as OrganizationRolesApi,
|
|
100
|
+
)
|
|
101
|
+
from phasetwo.openapi.api.organization_scim_api import (
|
|
102
|
+
OrganizationSCIMApi as OrganizationSCIMApi,
|
|
103
|
+
)
|
|
104
|
+
from phasetwo.openapi.api.organizations_api import OrganizationsApi as OrganizationsApi
|
|
105
|
+
from phasetwo.openapi.api.users_api import UsersApi as UsersApi
|
|
106
|
+
|
|
107
|
+
# import ApiClient
|
|
108
|
+
from phasetwo.openapi.api_response import ApiResponse as ApiResponse
|
|
109
|
+
from phasetwo.openapi.api_client import ApiClient as ApiClient
|
|
110
|
+
from phasetwo.openapi.configuration import Configuration as Configuration
|
|
111
|
+
from phasetwo.openapi.exceptions import OpenApiException as OpenApiException
|
|
112
|
+
from phasetwo.openapi.exceptions import ApiTypeError as ApiTypeError
|
|
113
|
+
from phasetwo.openapi.exceptions import ApiValueError as ApiValueError
|
|
114
|
+
from phasetwo.openapi.exceptions import ApiKeyError as ApiKeyError
|
|
115
|
+
from phasetwo.openapi.exceptions import ApiAttributeError as ApiAttributeError
|
|
116
|
+
from phasetwo.openapi.exceptions import ApiException as ApiException
|
|
117
|
+
|
|
118
|
+
# import models into sdk package
|
|
119
|
+
from phasetwo.openapi.models.access_token_response import (
|
|
120
|
+
AccessTokenResponse as AccessTokenResponse,
|
|
121
|
+
)
|
|
122
|
+
from phasetwo.openapi.models.auth_details_representation import (
|
|
123
|
+
AuthDetailsRepresentation as AuthDetailsRepresentation,
|
|
124
|
+
)
|
|
125
|
+
from phasetwo.openapi.models.bulk_response_item import (
|
|
126
|
+
BulkResponseItem as BulkResponseItem,
|
|
127
|
+
)
|
|
128
|
+
from phasetwo.openapi.models.credential_representation import (
|
|
129
|
+
CredentialRepresentation as CredentialRepresentation,
|
|
130
|
+
)
|
|
131
|
+
from phasetwo.openapi.models.event_representation import (
|
|
132
|
+
EventRepresentation as EventRepresentation,
|
|
133
|
+
)
|
|
134
|
+
from phasetwo.openapi.models.external_basic_scim_auth import (
|
|
135
|
+
ExternalBasicScimAuth as ExternalBasicScimAuth,
|
|
136
|
+
)
|
|
137
|
+
from phasetwo.openapi.models.external_jwt_scim_auth import (
|
|
138
|
+
ExternalJwtScimAuth as ExternalJwtScimAuth,
|
|
139
|
+
)
|
|
140
|
+
from phasetwo.openapi.models.external_secret_scim_auth import (
|
|
141
|
+
ExternalSecretScimAuth as ExternalSecretScimAuth,
|
|
142
|
+
)
|
|
143
|
+
from phasetwo.openapi.models.identity_provider_mapper_representation import (
|
|
144
|
+
IdentityProviderMapperRepresentation as IdentityProviderMapperRepresentation,
|
|
145
|
+
)
|
|
146
|
+
from phasetwo.openapi.models.identity_provider_representation import (
|
|
147
|
+
IdentityProviderRepresentation as IdentityProviderRepresentation,
|
|
148
|
+
)
|
|
149
|
+
from phasetwo.openapi.models.idp_initiated_client_representation import (
|
|
150
|
+
IdpInitiatedClientRepresentation as IdpInitiatedClientRepresentation,
|
|
151
|
+
)
|
|
152
|
+
from phasetwo.openapi.models.idp_initiated_client_representation_attributes import (
|
|
153
|
+
IdpInitiatedClientRepresentationAttributes as IdpInitiatedClientRepresentationAttributes,
|
|
154
|
+
)
|
|
155
|
+
from phasetwo.openapi.models.invitation_representation import (
|
|
156
|
+
InvitationRepresentation as InvitationRepresentation,
|
|
157
|
+
)
|
|
158
|
+
from phasetwo.openapi.models.invitation_request_representation import (
|
|
159
|
+
InvitationRequestRepresentation as InvitationRequestRepresentation,
|
|
160
|
+
)
|
|
161
|
+
from phasetwo.openapi.models.keycloak_scim_auth import (
|
|
162
|
+
KeycloakScimAuth as KeycloakScimAuth,
|
|
163
|
+
)
|
|
164
|
+
from phasetwo.openapi.models.link_identity_provider_representation import (
|
|
165
|
+
LinkIdentityProviderRepresentation as LinkIdentityProviderRepresentation,
|
|
166
|
+
)
|
|
167
|
+
from phasetwo.openapi.models.magic_link_request import (
|
|
168
|
+
MagicLinkRequest as MagicLinkRequest,
|
|
169
|
+
)
|
|
170
|
+
from phasetwo.openapi.models.magic_link_response import (
|
|
171
|
+
MagicLinkResponse as MagicLinkResponse,
|
|
172
|
+
)
|
|
173
|
+
from phasetwo.openapi.models.my_organization_representation import (
|
|
174
|
+
MyOrganizationRepresentation as MyOrganizationRepresentation,
|
|
175
|
+
)
|
|
176
|
+
from phasetwo.openapi.models.organization_config_representation import (
|
|
177
|
+
OrganizationConfigRepresentation as OrganizationConfigRepresentation,
|
|
178
|
+
)
|
|
179
|
+
from phasetwo.openapi.models.organization_domain_representation import (
|
|
180
|
+
OrganizationDomainRepresentation as OrganizationDomainRepresentation,
|
|
181
|
+
)
|
|
182
|
+
from phasetwo.openapi.models.organization_export_representation import (
|
|
183
|
+
OrganizationExportRepresentation as OrganizationExportRepresentation,
|
|
184
|
+
)
|
|
185
|
+
from phasetwo.openapi.models.organization_export_representation_all_of_members import (
|
|
186
|
+
OrganizationExportRepresentationAllOfMembers as OrganizationExportRepresentationAllOfMembers,
|
|
187
|
+
)
|
|
188
|
+
from phasetwo.openapi.models.organization_member_attribute_representation import (
|
|
189
|
+
OrganizationMemberAttributeRepresentation as OrganizationMemberAttributeRepresentation,
|
|
190
|
+
)
|
|
191
|
+
from phasetwo.openapi.models.organization_representation import (
|
|
192
|
+
OrganizationRepresentation as OrganizationRepresentation,
|
|
193
|
+
)
|
|
194
|
+
from phasetwo.openapi.models.organization_role_representation import (
|
|
195
|
+
OrganizationRoleRepresentation as OrganizationRoleRepresentation,
|
|
196
|
+
)
|
|
197
|
+
from phasetwo.openapi.models.organization_scim_auth import (
|
|
198
|
+
OrganizationScimAuth as OrganizationScimAuth,
|
|
199
|
+
)
|
|
200
|
+
from phasetwo.openapi.models.organization_scim_representation import (
|
|
201
|
+
OrganizationScimRepresentation as OrganizationScimRepresentation,
|
|
202
|
+
)
|
|
203
|
+
from phasetwo.openapi.models.organizations_config_representation import (
|
|
204
|
+
OrganizationsConfigRepresentation as OrganizationsConfigRepresentation,
|
|
205
|
+
)
|
|
206
|
+
from phasetwo.openapi.models.organizations_export_representation import (
|
|
207
|
+
OrganizationsExportRepresentation as OrganizationsExportRepresentation,
|
|
208
|
+
)
|
|
209
|
+
from phasetwo.openapi.models.organizations_import_representation import (
|
|
210
|
+
OrganizationsImportRepresentation as OrganizationsImportRepresentation,
|
|
211
|
+
)
|
|
212
|
+
from phasetwo.openapi.models.organizations_import_result_representation import (
|
|
213
|
+
OrganizationsImportResultRepresentation as OrganizationsImportResultRepresentation,
|
|
214
|
+
)
|
|
215
|
+
from phasetwo.openapi.models.organizations_import_result_representation_errors_inner import (
|
|
216
|
+
OrganizationsImportResultRepresentationErrorsInner as OrganizationsImportResultRepresentationErrorsInner,
|
|
217
|
+
)
|
|
218
|
+
from phasetwo.openapi.models.portal_link_representation import (
|
|
219
|
+
PortalLinkRepresentation as PortalLinkRepresentation,
|
|
220
|
+
)
|
|
221
|
+
from phasetwo.openapi.models.realm_attribute_representation import (
|
|
222
|
+
RealmAttributeRepresentation as RealmAttributeRepresentation,
|
|
223
|
+
)
|
|
224
|
+
from phasetwo.openapi.models.switch_organization_representation import (
|
|
225
|
+
SwitchOrganizationRepresentation as SwitchOrganizationRepresentation,
|
|
226
|
+
)
|
|
227
|
+
from phasetwo.openapi.models.user_brief_representation import (
|
|
228
|
+
UserBriefRepresentation as UserBriefRepresentation,
|
|
229
|
+
)
|
|
230
|
+
from phasetwo.openapi.models.user_representation import (
|
|
231
|
+
UserRepresentation as UserRepresentation,
|
|
232
|
+
)
|
|
233
|
+
from phasetwo.openapi.models.user_with_orgs_brief_representation import (
|
|
234
|
+
UserWithOrgsBriefRepresentation as UserWithOrgsBriefRepresentation,
|
|
235
|
+
)
|
|
236
|
+
from phasetwo.openapi.models.user_with_orgs_representation import (
|
|
237
|
+
UserWithOrgsRepresentation as UserWithOrgsRepresentation,
|
|
238
|
+
)
|
|
239
|
+
from phasetwo.openapi.models.webhook_representation import (
|
|
240
|
+
WebhookRepresentation as WebhookRepresentation,
|
|
241
|
+
)
|
|
242
|
+
from phasetwo.openapi.models.webhook_send_representation import (
|
|
243
|
+
WebhookSendRepresentation as WebhookSendRepresentation,
|
|
244
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# flake8: noqa
|
|
2
|
+
|
|
3
|
+
# import apis into api package
|
|
4
|
+
from phasetwo.openapi.api.attributes_api import AttributesApi
|
|
5
|
+
from phasetwo.openapi.api.events_api import EventsApi
|
|
6
|
+
from phasetwo.openapi.api.identity_providers_api import IdentityProvidersApi
|
|
7
|
+
from phasetwo.openapi.api.organization_domains_api import OrganizationDomainsApi
|
|
8
|
+
from phasetwo.openapi.api.organization_invitations_api import OrganizationInvitationsApi
|
|
9
|
+
from phasetwo.openapi.api.organization_memberships_api import OrganizationMembershipsApi
|
|
10
|
+
from phasetwo.openapi.api.organization_roles_api import OrganizationRolesApi
|
|
11
|
+
from phasetwo.openapi.api.organization_scim_api import OrganizationSCIMApi
|
|
12
|
+
from phasetwo.openapi.api.organizations_api import OrganizationsApi
|
|
13
|
+
from phasetwo.openapi.api.users_api import UsersApi
|