From 11956abbaa2e1121edeb4d01047141e6532b80c5 Mon Sep 17 00:00:00 2001 From: Koosha Owji Date: Thu, 20 Aug 2026 15:18:53 +1000 Subject: [PATCH] chore: regenerate management SDK from latest API spec --- .openapi-generator/FILES | 21 + kinde_sdk/management/__init__.py | 14 + kinde_sdk/management/api/applications_api.py | 892 ++++++++++++++++++ kinde_sdk/management/api/organizations_api.py | 691 +++++++++++++- kinde_sdk/management/api/users_api.py | 307 +++++- kinde_sdk/management/api_client.py | 2 +- kinde_sdk/management/configuration.py | 2 +- kinde_sdk/management/models/__init__.py | 7 + .../models/application_access_role.py | 99 ++ ...eate_connection_request_options_one_of2.py | 6 +- .../models/create_directory_request.py | 7 +- .../models/create_organization_request.py | 6 +- .../create_user_billing_customer_request.py | 92 ++ .../create_user_billing_customer_response.py | 96 ++ ...ling_customer_response_billing_customer.py | 90 ++ .../get_application_access_roles_response.py | 102 ++ .../get_application_response_application.py | 24 +- ...ng_agreements_response_agreements_inner.py | 26 +- ...zation_role_active_users_count_response.py | 97 ++ ..._organization_role_users_count_response.py | 92 ++ ...lace_connection_request_options_one_of1.py | 6 +- .../models/set_user_password_request.py | 22 +- .../models/update_application_request.py | 22 +- ...date_connection_request_options_one_of1.py | 6 +- .../models/update_organization_request.py | 2 +- .../management/models/update_user_request.py | 4 +- 26 files changed, 2669 insertions(+), 66 deletions(-) create mode 100644 kinde_sdk/management/models/application_access_role.py create mode 100644 kinde_sdk/management/models/create_user_billing_customer_request.py create mode 100644 kinde_sdk/management/models/create_user_billing_customer_response.py create mode 100644 kinde_sdk/management/models/create_user_billing_customer_response_billing_customer.py create mode 100644 kinde_sdk/management/models/get_application_access_roles_response.py create mode 100644 kinde_sdk/management/models/get_organization_role_active_users_count_response.py create mode 100644 kinde_sdk/management/models/get_organization_role_users_count_response.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index e1e66641..fa0aa102 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -40,6 +40,7 @@ kinde_sdk/management/docs/AddOrganizationUsersResponse.md kinde_sdk/management/docs/AddRoleScopeRequest.md kinde_sdk/management/docs/AddRoleScopeResponse.md kinde_sdk/management/docs/ApiResult.md +kinde_sdk/management/docs/ApplicationAccessRole.md kinde_sdk/management/docs/Applications.md kinde_sdk/management/docs/ApplicationsApi.md kinde_sdk/management/docs/AuthorizeAppApiResponse.md @@ -103,6 +104,9 @@ kinde_sdk/management/docs/CreateRolesResponse.md kinde_sdk/management/docs/CreateRolesResponseRole.md kinde_sdk/management/docs/CreateSubscriberSuccessResponse.md kinde_sdk/management/docs/CreateSubscriberSuccessResponseSubscriber.md +kinde_sdk/management/docs/CreateUserBillingCustomerRequest.md +kinde_sdk/management/docs/CreateUserBillingCustomerResponse.md +kinde_sdk/management/docs/CreateUserBillingCustomerResponseBillingCustomer.md kinde_sdk/management/docs/CreateUserIdentityRequest.md kinde_sdk/management/docs/CreateUserRequest.md kinde_sdk/management/docs/CreateUserRequestIdentitiesInner.md @@ -140,6 +144,7 @@ kinde_sdk/management/docs/GetApiScopesResponseScopesInner.md kinde_sdk/management/docs/GetApisResponse.md kinde_sdk/management/docs/GetApisResponseApisInner.md kinde_sdk/management/docs/GetApisResponseApisInnerScopesInner.md +kinde_sdk/management/docs/GetApplicationAccessRolesResponse.md kinde_sdk/management/docs/GetApplicationResponse.md kinde_sdk/management/docs/GetApplicationResponseApplication.md kinde_sdk/management/docs/GetApplicationsResponse.md @@ -177,6 +182,8 @@ kinde_sdk/management/docs/GetOrganizationPasskey200Response.md kinde_sdk/management/docs/GetOrganizationResponse.md kinde_sdk/management/docs/GetOrganizationResponseBilling.md kinde_sdk/management/docs/GetOrganizationResponseBillingAgreementsInner.md +kinde_sdk/management/docs/GetOrganizationRoleActiveUsersCountResponse.md +kinde_sdk/management/docs/GetOrganizationRoleUsersCountResponse.md kinde_sdk/management/docs/GetOrganizationRoleUsersResponse.md kinde_sdk/management/docs/GetOrganizationRoleUsersResponseUsersInner.md kinde_sdk/management/docs/GetOrganizationUsersResponse.md @@ -325,6 +332,7 @@ kinde_sdk/management/models/add_organization_users_response.py kinde_sdk/management/models/add_role_scope_request.py kinde_sdk/management/models/add_role_scope_response.py kinde_sdk/management/models/api_result.py +kinde_sdk/management/models/application_access_role.py kinde_sdk/management/models/applications.py kinde_sdk/management/models/authorize_app_api_response.py kinde_sdk/management/models/category.py @@ -380,6 +388,9 @@ kinde_sdk/management/models/create_roles_response.py kinde_sdk/management/models/create_roles_response_role.py kinde_sdk/management/models/create_subscriber_success_response.py kinde_sdk/management/models/create_subscriber_success_response_subscriber.py +kinde_sdk/management/models/create_user_billing_customer_request.py +kinde_sdk/management/models/create_user_billing_customer_response.py +kinde_sdk/management/models/create_user_billing_customer_response_billing_customer.py kinde_sdk/management/models/create_user_identity_request.py kinde_sdk/management/models/create_user_request.py kinde_sdk/management/models/create_user_request_identities_inner.py @@ -413,6 +424,7 @@ kinde_sdk/management/models/get_api_scopes_response_scopes_inner.py kinde_sdk/management/models/get_apis_response.py kinde_sdk/management/models/get_apis_response_apis_inner.py kinde_sdk/management/models/get_apis_response_apis_inner_scopes_inner.py +kinde_sdk/management/models/get_application_access_roles_response.py kinde_sdk/management/models/get_application_response.py kinde_sdk/management/models/get_application_response_application.py kinde_sdk/management/models/get_applications_response.py @@ -450,6 +462,8 @@ kinde_sdk/management/models/get_organization_passkey200_response.py kinde_sdk/management/models/get_organization_response.py kinde_sdk/management/models/get_organization_response_billing.py kinde_sdk/management/models/get_organization_response_billing_agreements_inner.py +kinde_sdk/management/models/get_organization_role_active_users_count_response.py +kinde_sdk/management/models/get_organization_role_users_count_response.py kinde_sdk/management/models/get_organization_role_users_response.py kinde_sdk/management/models/get_organization_role_users_response_users_inner.py kinde_sdk/management/models/get_organization_users_response.py @@ -587,6 +601,7 @@ kinde_sdk/management/test/test_add_role_scope_response.py kinde_sdk/management/test/test_api_keys_api.py kinde_sdk/management/test/test_api_result.py kinde_sdk/management/test/test_apis_api.py +kinde_sdk/management/test/test_application_access_role.py kinde_sdk/management/test/test_applications.py kinde_sdk/management/test/test_applications_api.py kinde_sdk/management/test/test_authorize_app_api_response.py @@ -650,6 +665,9 @@ kinde_sdk/management/test/test_create_roles_response.py kinde_sdk/management/test/test_create_roles_response_role.py kinde_sdk/management/test/test_create_subscriber_success_response.py kinde_sdk/management/test/test_create_subscriber_success_response_subscriber.py +kinde_sdk/management/test/test_create_user_billing_customer_request.py +kinde_sdk/management/test/test_create_user_billing_customer_response.py +kinde_sdk/management/test/test_create_user_billing_customer_response_billing_customer.py kinde_sdk/management/test/test_create_user_identity_request.py kinde_sdk/management/test/test_create_user_request.py kinde_sdk/management/test/test_create_user_request_identities_inner.py @@ -687,6 +705,7 @@ kinde_sdk/management/test/test_get_api_scopes_response_scopes_inner.py kinde_sdk/management/test/test_get_apis_response.py kinde_sdk/management/test/test_get_apis_response_apis_inner.py kinde_sdk/management/test/test_get_apis_response_apis_inner_scopes_inner.py +kinde_sdk/management/test/test_get_application_access_roles_response.py kinde_sdk/management/test/test_get_application_response.py kinde_sdk/management/test/test_get_application_response_application.py kinde_sdk/management/test/test_get_applications_response.py @@ -724,6 +743,8 @@ kinde_sdk/management/test/test_get_organization_passkey200_response.py kinde_sdk/management/test/test_get_organization_response.py kinde_sdk/management/test/test_get_organization_response_billing.py kinde_sdk/management/test/test_get_organization_response_billing_agreements_inner.py +kinde_sdk/management/test/test_get_organization_role_active_users_count_response.py +kinde_sdk/management/test/test_get_organization_role_users_count_response.py kinde_sdk/management/test/test_get_organization_role_users_response.py kinde_sdk/management/test/test_get_organization_role_users_response_users_inner.py kinde_sdk/management/test/test_get_organization_users_response.py diff --git a/kinde_sdk/management/__init__.py b/kinde_sdk/management/__init__.py index 5388b1cb..6c476413 100644 --- a/kinde_sdk/management/__init__.py +++ b/kinde_sdk/management/__init__.py @@ -62,6 +62,7 @@ "AddRoleScopeRequest", "AddRoleScopeResponse", "ApiResult", + "ApplicationAccessRole", "Applications", "AuthorizeAppApiResponse", "Category", @@ -117,6 +118,9 @@ "CreateRolesResponseRole", "CreateSubscriberSuccessResponse", "CreateSubscriberSuccessResponseSubscriber", + "CreateUserBillingCustomerRequest", + "CreateUserBillingCustomerResponse", + "CreateUserBillingCustomerResponseBillingCustomer", "CreateUserIdentityRequest", "CreateUserRequest", "CreateUserRequestIdentitiesInner", @@ -150,6 +154,7 @@ "GetApisResponse", "GetApisResponseApisInner", "GetApisResponseApisInnerScopesInner", + "GetApplicationAccessRolesResponse", "GetApplicationResponse", "GetApplicationResponseApplication", "GetApplicationsResponse", @@ -187,6 +192,8 @@ "GetOrganizationResponse", "GetOrganizationResponseBilling", "GetOrganizationResponseBillingAgreementsInner", + "GetOrganizationRoleActiveUsersCountResponse", + "GetOrganizationRoleUsersCountResponse", "GetOrganizationRoleUsersResponse", "GetOrganizationRoleUsersResponseUsersInner", "GetOrganizationUsersResponse", @@ -363,6 +370,7 @@ from kinde_sdk.management.models.add_role_scope_request import AddRoleScopeRequest as AddRoleScopeRequest from kinde_sdk.management.models.add_role_scope_response import AddRoleScopeResponse as AddRoleScopeResponse from kinde_sdk.management.models.api_result import ApiResult as ApiResult +from kinde_sdk.management.models.application_access_role import ApplicationAccessRole as ApplicationAccessRole from kinde_sdk.management.models.applications import Applications as Applications from kinde_sdk.management.models.authorize_app_api_response import AuthorizeAppApiResponse as AuthorizeAppApiResponse from kinde_sdk.management.models.category import Category as Category @@ -418,6 +426,9 @@ from kinde_sdk.management.models.create_roles_response_role import CreateRolesResponseRole as CreateRolesResponseRole from kinde_sdk.management.models.create_subscriber_success_response import CreateSubscriberSuccessResponse as CreateSubscriberSuccessResponse from kinde_sdk.management.models.create_subscriber_success_response_subscriber import CreateSubscriberSuccessResponseSubscriber as CreateSubscriberSuccessResponseSubscriber +from kinde_sdk.management.models.create_user_billing_customer_request import CreateUserBillingCustomerRequest as CreateUserBillingCustomerRequest +from kinde_sdk.management.models.create_user_billing_customer_response import CreateUserBillingCustomerResponse as CreateUserBillingCustomerResponse +from kinde_sdk.management.models.create_user_billing_customer_response_billing_customer import CreateUserBillingCustomerResponseBillingCustomer as CreateUserBillingCustomerResponseBillingCustomer from kinde_sdk.management.models.create_user_identity_request import CreateUserIdentityRequest as CreateUserIdentityRequest from kinde_sdk.management.models.create_user_request import CreateUserRequest as CreateUserRequest from kinde_sdk.management.models.create_user_request_identities_inner import CreateUserRequestIdentitiesInner as CreateUserRequestIdentitiesInner @@ -451,6 +462,7 @@ from kinde_sdk.management.models.get_apis_response import GetApisResponse as GetApisResponse from kinde_sdk.management.models.get_apis_response_apis_inner import GetApisResponseApisInner as GetApisResponseApisInner from kinde_sdk.management.models.get_apis_response_apis_inner_scopes_inner import GetApisResponseApisInnerScopesInner as GetApisResponseApisInnerScopesInner +from kinde_sdk.management.models.get_application_access_roles_response import GetApplicationAccessRolesResponse as GetApplicationAccessRolesResponse from kinde_sdk.management.models.get_application_response import GetApplicationResponse as GetApplicationResponse from kinde_sdk.management.models.get_application_response_application import GetApplicationResponseApplication as GetApplicationResponseApplication from kinde_sdk.management.models.get_applications_response import GetApplicationsResponse as GetApplicationsResponse @@ -488,6 +500,8 @@ from kinde_sdk.management.models.get_organization_response import GetOrganizationResponse as GetOrganizationResponse from kinde_sdk.management.models.get_organization_response_billing import GetOrganizationResponseBilling as GetOrganizationResponseBilling from kinde_sdk.management.models.get_organization_response_billing_agreements_inner import GetOrganizationResponseBillingAgreementsInner as GetOrganizationResponseBillingAgreementsInner +from kinde_sdk.management.models.get_organization_role_active_users_count_response import GetOrganizationRoleActiveUsersCountResponse as GetOrganizationRoleActiveUsersCountResponse +from kinde_sdk.management.models.get_organization_role_users_count_response import GetOrganizationRoleUsersCountResponse as GetOrganizationRoleUsersCountResponse from kinde_sdk.management.models.get_organization_role_users_response import GetOrganizationRoleUsersResponse as GetOrganizationRoleUsersResponse from kinde_sdk.management.models.get_organization_role_users_response_users_inner import GetOrganizationRoleUsersResponseUsersInner as GetOrganizationRoleUsersResponseUsersInner from kinde_sdk.management.models.get_organization_users_response import GetOrganizationUsersResponse as GetOrganizationUsersResponse diff --git a/kinde_sdk/management/api/applications_api.py b/kinde_sdk/management/api/applications_api.py index 5ce58184..df49986b 100644 --- a/kinde_sdk/management/api/applications_api.py +++ b/kinde_sdk/management/api/applications_api.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from kinde_sdk.management.models.create_application_request import CreateApplicationRequest from kinde_sdk.management.models.create_application_response import CreateApplicationResponse +from kinde_sdk.management.models.get_application_access_roles_response import GetApplicationAccessRolesResponse from kinde_sdk.management.models.get_application_response import GetApplicationResponse from kinde_sdk.management.models.get_applications_response import GetApplicationsResponse from kinde_sdk.management.models.get_connections_response import GetConnectionsResponse @@ -49,6 +50,291 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def add_application_access_role( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + role_id: Annotated[StrictStr, Field(description="The identifier for the role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessResponse: + """Add application access role + + Add a role to the set configured as allowed to access an application. Adding a role does not enable role-based access control for the application.
update:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param role_id: The identifier for the role. (required) + :type role_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_application_access_role_serialize( + application_id=application_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_application_access_role_with_http_info( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + role_id: Annotated[StrictStr, Field(description="The identifier for the role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[SuccessResponse]: + """Add application access role + + Add a role to the set configured as allowed to access an application. Adding a role does not enable role-based access control for the application.
update:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param role_id: The identifier for the role. (required) + :type role_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_application_access_role_serialize( + application_id=application_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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 add_application_access_role_without_preload_content( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + role_id: Annotated[StrictStr, Field(description="The identifier for the role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 application access role + + Add a role to the set configured as allowed to access an application. Adding a role does not enable role-based access control for the application.
update:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param role_id: The identifier for the role. (required) + :type role_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_application_access_role_serialize( + application_id=application_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_application_access_role_serialize( + self, + application_id, + role_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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['application_id'] = application_id + if role_id is not None: + _path_params['role_id'] = role_id + # 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] = [ + 'kindeBearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/applications/{application_id}/access_roles/{role_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 create_application( self, @@ -1157,6 +1443,327 @@ def _get_application_serialize( + @validate_call + def get_application_access_roles( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + page_size: Annotated[Optional[StrictInt], Field(description="Number of results per page. Defaults to 10 if parameter not sent.")] = None, + starting_after: Annotated[Optional[StrictStr], Field(description="The ID of the role to start after.")] = None, + ending_before: Annotated[Optional[StrictStr], Field(description="The ID of the role to end before.")] = 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, + ) -> GetApplicationAccessRolesResponse: + """Get application access roles + + Gets the roles configured as allowed to access an application. These roles are enforced only when role-based access control is enabled for the application.
read:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param page_size: Number of results per page. Defaults to 10 if parameter not sent. + :type page_size: int + :param starting_after: The ID of the role to start after. + :type starting_after: str + :param ending_before: The ID of the role to end before. + :type ending_before: 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_application_access_roles_serialize( + application_id=application_id, + page_size=page_size, + starting_after=starting_after, + ending_before=ending_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetApplicationAccessRolesResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_application_access_roles_with_http_info( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + page_size: Annotated[Optional[StrictInt], Field(description="Number of results per page. Defaults to 10 if parameter not sent.")] = None, + starting_after: Annotated[Optional[StrictStr], Field(description="The ID of the role to start after.")] = None, + ending_before: Annotated[Optional[StrictStr], Field(description="The ID of the role to end before.")] = 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[GetApplicationAccessRolesResponse]: + """Get application access roles + + Gets the roles configured as allowed to access an application. These roles are enforced only when role-based access control is enabled for the application.
read:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param page_size: Number of results per page. Defaults to 10 if parameter not sent. + :type page_size: int + :param starting_after: The ID of the role to start after. + :type starting_after: str + :param ending_before: The ID of the role to end before. + :type ending_before: 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_application_access_roles_serialize( + application_id=application_id, + page_size=page_size, + starting_after=starting_after, + ending_before=ending_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetApplicationAccessRolesResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_application_access_roles_without_preload_content( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + page_size: Annotated[Optional[StrictInt], Field(description="Number of results per page. Defaults to 10 if parameter not sent.")] = None, + starting_after: Annotated[Optional[StrictStr], Field(description="The ID of the role to start after.")] = None, + ending_before: Annotated[Optional[StrictStr], Field(description="The ID of the role to end before.")] = 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 application access roles + + Gets the roles configured as allowed to access an application. These roles are enforced only when role-based access control is enabled for the application.
read:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param page_size: Number of results per page. Defaults to 10 if parameter not sent. + :type page_size: int + :param starting_after: The ID of the role to start after. + :type starting_after: str + :param ending_before: The ID of the role to end before. + :type ending_before: 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_application_access_roles_serialize( + application_id=application_id, + page_size=page_size, + starting_after=starting_after, + ending_before=ending_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetApplicationAccessRolesResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_application_access_roles_serialize( + self, + application_id, + page_size, + starting_after, + ending_before, + _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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['application_id'] = application_id + # process the query parameters + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if starting_after is not None: + + _query_params.append(('starting_after', starting_after)) + + if ending_before is not None: + + _query_params.append(('ending_before', ending_before)) + + # 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] = [ + 'kindeBearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/applications/{application_id}/access_roles', + 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_application_connections( self, @@ -2003,6 +2610,291 @@ def _get_applications_serialize( + @validate_call + def remove_application_access_role( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + role_id: Annotated[StrictStr, Field(description="The identifier for the role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessResponse: + """Remove application access role + + Remove a role from the set that is allowed to access an application. Removing a role does not change whether role-based access control is enabled for the application.
update:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param role_id: The identifier for the role. (required) + :type role_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._remove_application_access_role_serialize( + application_id=application_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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 remove_application_access_role_with_http_info( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + role_id: Annotated[StrictStr, Field(description="The identifier for the role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[SuccessResponse]: + """Remove application access role + + Remove a role from the set that is allowed to access an application. Removing a role does not change whether role-based access control is enabled for the application.
update:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param role_id: The identifier for the role. (required) + :type role_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._remove_application_access_role_serialize( + application_id=application_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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 remove_application_access_role_without_preload_content( + self, + application_id: Annotated[StrictStr, Field(description="The identifier/client ID for the application.")], + role_id: Annotated[StrictStr, Field(description="The identifier for the role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Remove application access role + + Remove a role from the set that is allowed to access an application. Removing a role does not change whether role-based access control is enabled for the application.
update:applications
+ + :param application_id: The identifier/client ID for the application. (required) + :type application_id: str + :param role_id: The identifier for the role. (required) + :type role_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._remove_application_access_role_serialize( + application_id=application_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_application_access_role_serialize( + self, + application_id, + role_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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if application_id is not None: + _path_params['application_id'] = application_id + if role_id is not None: + _path_params['role_id'] = role_id + # 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] = [ + 'kindeBearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/applications/{application_id}/access_roles/{role_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 remove_connection( self, diff --git a/kinde_sdk/management/api/organizations_api.py b/kinde_sdk/management/api/organizations_api.py index 4285f2b0..86e2b731 100644 --- a/kinde_sdk/management/api/organizations_api.py +++ b/kinde_sdk/management/api/organizations_api.py @@ -17,6 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from datetime import datetime from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator from typing import Optional, Tuple, Union from typing_extensions import Annotated @@ -34,6 +35,8 @@ from kinde_sdk.management.models.get_organization_invites_response import GetOrganizationInvitesResponse from kinde_sdk.management.models.get_organization_passkey200_response import GetOrganizationPasskey200Response from kinde_sdk.management.models.get_organization_response import GetOrganizationResponse +from kinde_sdk.management.models.get_organization_role_active_users_count_response import GetOrganizationRoleActiveUsersCountResponse +from kinde_sdk.management.models.get_organization_role_users_count_response import GetOrganizationRoleUsersCountResponse from kinde_sdk.management.models.get_organization_role_users_response import GetOrganizationRoleUsersResponse from kinde_sdk.management.models.get_organization_users_response import GetOrganizationUsersResponse from kinde_sdk.management.models.get_organizations_response import GetOrganizationsResponse @@ -7380,6 +7383,344 @@ def _get_organization_property_values_serialize( + @validate_call + def get_organization_role_active_users_count( + self, + org_code: Annotated[StrictStr, Field(description="The organization's code.")], + role_id: Annotated[StrictStr, Field(description="The role's public id.")], + date_time_from: Annotated[datetime, Field(description="Start of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded down to the nearest second before validation.")], + date_time_to: Annotated[datetime, Field(description="End of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded up to the nearest second before validation. The window must not exceed 3 days, so this must be earlier than `date_time_from` plus 3 days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetOrganizationRoleActiveUsersCountResponse: + """Get organization role active users count + + Get the number of active users that hold a given role within a specific organization. A user is counted as active if they were issued at least one access token during the requested period, regardless of organization context on the token. Only users who currently hold the role in the organization are included. The count is scoped to the current environment. Both `date_time_from` and `date_time_to` are required, inclusive, and must be ISO 8601 datetimes in UTC. Provide them at second precision (no fractional seconds). If a value includes fractional seconds, it is normalized before any other processing: `date_time_from` is rounded down and `date_time_to` is rounded up to the nearest second. Window validation, the active-user query, and the echoed response bounds all use those normalized values. The requested window must not exceed 3 days. Because both bounds are inclusive, this means `date_time_to` must be earlier than `date_time_from` plus 3 days. For example, `2026-07-01T00:00:00Z` to `2026-07-03T23:59:59Z` is a full 3 day window covering the whole of 1, 2 and 3 July. A longer window is rejected with `DATE_TIME_RANGE_TOO_LARGE`.
read:organization_user_roles
+ + :param org_code: The organization's code. (required) + :type org_code: str + :param role_id: The role's public id. (required) + :type role_id: str + :param date_time_from: Start of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded down to the nearest second before validation. (required) + :type date_time_from: datetime + :param date_time_to: End of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded up to the nearest second before validation. The window must not exceed 3 days, so this must be earlier than `date_time_from` plus 3 days. (required) + :type date_time_to: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_organization_role_active_users_count_serialize( + org_code=org_code, + role_id=role_id, + date_time_from=date_time_from, + date_time_to=date_time_to, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetOrganizationRoleActiveUsersCountResponse", + '400': "ErrorResponse", + '403': None, + '429': 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_organization_role_active_users_count_with_http_info( + self, + org_code: Annotated[StrictStr, Field(description="The organization's code.")], + role_id: Annotated[StrictStr, Field(description="The role's public id.")], + date_time_from: Annotated[datetime, Field(description="Start of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded down to the nearest second before validation.")], + date_time_to: Annotated[datetime, Field(description="End of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded up to the nearest second before validation. The window must not exceed 3 days, so this must be earlier than `date_time_from` plus 3 days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GetOrganizationRoleActiveUsersCountResponse]: + """Get organization role active users count + + Get the number of active users that hold a given role within a specific organization. A user is counted as active if they were issued at least one access token during the requested period, regardless of organization context on the token. Only users who currently hold the role in the organization are included. The count is scoped to the current environment. Both `date_time_from` and `date_time_to` are required, inclusive, and must be ISO 8601 datetimes in UTC. Provide them at second precision (no fractional seconds). If a value includes fractional seconds, it is normalized before any other processing: `date_time_from` is rounded down and `date_time_to` is rounded up to the nearest second. Window validation, the active-user query, and the echoed response bounds all use those normalized values. The requested window must not exceed 3 days. Because both bounds are inclusive, this means `date_time_to` must be earlier than `date_time_from` plus 3 days. For example, `2026-07-01T00:00:00Z` to `2026-07-03T23:59:59Z` is a full 3 day window covering the whole of 1, 2 and 3 July. A longer window is rejected with `DATE_TIME_RANGE_TOO_LARGE`.
read:organization_user_roles
+ + :param org_code: The organization's code. (required) + :type org_code: str + :param role_id: The role's public id. (required) + :type role_id: str + :param date_time_from: Start of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded down to the nearest second before validation. (required) + :type date_time_from: datetime + :param date_time_to: End of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded up to the nearest second before validation. The window must not exceed 3 days, so this must be earlier than `date_time_from` plus 3 days. (required) + :type date_time_to: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_organization_role_active_users_count_serialize( + org_code=org_code, + role_id=role_id, + date_time_from=date_time_from, + date_time_to=date_time_to, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetOrganizationRoleActiveUsersCountResponse", + '400': "ErrorResponse", + '403': None, + '429': 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_organization_role_active_users_count_without_preload_content( + self, + org_code: Annotated[StrictStr, Field(description="The organization's code.")], + role_id: Annotated[StrictStr, Field(description="The role's public id.")], + date_time_from: Annotated[datetime, Field(description="Start of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded down to the nearest second before validation.")], + date_time_to: Annotated[datetime, Field(description="End of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded up to the nearest second before validation. The window must not exceed 3 days, so this must be earlier than `date_time_from` plus 3 days.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 organization role active users count + + Get the number of active users that hold a given role within a specific organization. A user is counted as active if they were issued at least one access token during the requested period, regardless of organization context on the token. Only users who currently hold the role in the organization are included. The count is scoped to the current environment. Both `date_time_from` and `date_time_to` are required, inclusive, and must be ISO 8601 datetimes in UTC. Provide them at second precision (no fractional seconds). If a value includes fractional seconds, it is normalized before any other processing: `date_time_from` is rounded down and `date_time_to` is rounded up to the nearest second. Window validation, the active-user query, and the echoed response bounds all use those normalized values. The requested window must not exceed 3 days. Because both bounds are inclusive, this means `date_time_to` must be earlier than `date_time_from` plus 3 days. For example, `2026-07-01T00:00:00Z` to `2026-07-03T23:59:59Z` is a full 3 day window covering the whole of 1, 2 and 3 July. A longer window is rejected with `DATE_TIME_RANGE_TOO_LARGE`.
read:organization_user_roles
+ + :param org_code: The organization's code. (required) + :type org_code: str + :param role_id: The role's public id. (required) + :type role_id: str + :param date_time_from: Start of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded down to the nearest second before validation. (required) + :type date_time_from: datetime + :param date_time_to: End of the active period (inclusive), as an ISO 8601 datetime in UTC at second precision. Fractional seconds are accepted but rounded up to the nearest second before validation. The window must not exceed 3 days, so this must be earlier than `date_time_from` plus 3 days. (required) + :type date_time_to: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_organization_role_active_users_count_serialize( + org_code=org_code, + role_id=role_id, + date_time_from=date_time_from, + date_time_to=date_time_to, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetOrganizationRoleActiveUsersCountResponse", + '400': "ErrorResponse", + '403': None, + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_organization_role_active_users_count_serialize( + self, + org_code, + role_id, + date_time_from, + date_time_to, + _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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if org_code is not None: + _path_params['org_code'] = org_code + if role_id is not None: + _path_params['role_id'] = role_id + # process the query parameters + if date_time_from is not None: + if isinstance(date_time_from, datetime): + _query_params.append( + ( + 'date_time_from', + date_time_from.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('date_time_from', date_time_from)) + + if date_time_to is not None: + if isinstance(date_time_to, datetime): + _query_params.append( + ( + 'date_time_to', + date_time_to.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('date_time_to', date_time_to)) + + # 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/json; charset=utf-8' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'kindeBearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/organizations/{org_code}/roles/{role_id}/active_users/count', + 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_organization_role_users( self, @@ -7399,7 +7740,89 @@ def get_organization_role_users( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetOrganizationRoleUsersResponse: + ) -> GetOrganizationRoleUsersResponse: + """List organization role users + + Get users that have a given role within a specific organization.
read:organization_user_roles
+ + :param org_code: The organization's code. (required) + :type org_code: str + :param role_id: The role's public id. (required) + :type role_id: str + :param page_size: Number of results per page. Defaults to 10 if parameter not sent. + :type page_size: int + :param next_token: A string to get the next page of results if there are more results. + :type next_token: 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_organization_role_users_serialize( + org_code=org_code, + role_id=role_id, + page_size=page_size, + next_token=next_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetOrganizationRoleUsersResponse", + '400': "ErrorResponse", + '403': None, + '429': 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_organization_role_users_with_http_info( + self, + org_code: Annotated[StrictStr, Field(description="The organization's code.")], + role_id: Annotated[StrictStr, Field(description="The role's public id.")], + page_size: Annotated[Optional[StrictInt], Field(description="Number of results per page. Defaults to 10 if parameter not sent.")] = None, + next_token: Annotated[Optional[StrictStr], Field(description="A string to get the next page of results if there are more results.")] = 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[GetOrganizationRoleUsersResponse]: """List organization role users Get users that have a given role within a specific organization.
read:organization_user_roles
@@ -7459,11 +7882,11 @@ def get_organization_role_users( return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, - ).data + ) @validate_call - def get_organization_role_users_with_http_info( + def get_organization_role_users_without_preload_content( self, org_code: Annotated[StrictStr, Field(description="The organization's code.")], role_id: Annotated[StrictStr, Field(description="The role's public id.")], @@ -7481,7 +7904,7 @@ def get_organization_role_users_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetOrganizationRoleUsersResponse]: + ) -> RESTResponseType: """List organization role users Get users that have a given role within a specific organization.
read:organization_user_roles
@@ -7537,6 +7960,228 @@ def get_organization_role_users_with_http_info( *_param, _request_timeout=_request_timeout ) + return response_data.response + + + def _get_organization_role_users_serialize( + self, + org_code, + role_id, + page_size, + next_token, + _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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if org_code is not None: + _path_params['org_code'] = org_code + if role_id is not None: + _path_params['role_id'] = role_id + # process the query parameters + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if next_token is not None: + + _query_params.append(('next_token', next_token)) + + # 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/json; charset=utf-8' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'kindeBearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/organizations/{org_code}/roles/{role_id}/users', + 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_organization_role_users_count( + self, + org_code: Annotated[StrictStr, Field(description="The organization's code.")], + role_id: Annotated[StrictStr, Field(description="The role's public id.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetOrganizationRoleUsersCountResponse: + """Count organization role users + + Get the number of users that have a given role within a specific organization.
read:organization_user_roles
+ + :param org_code: The organization's code. (required) + :type org_code: str + :param role_id: The role's public id. (required) + :type role_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_organization_role_users_count_serialize( + org_code=org_code, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetOrganizationRoleUsersCountResponse", + '400': "ErrorResponse", + '403': None, + '429': 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_organization_role_users_count_with_http_info( + self, + org_code: Annotated[StrictStr, Field(description="The organization's code.")], + role_id: Annotated[StrictStr, Field(description="The role's public id.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GetOrganizationRoleUsersCountResponse]: + """Count organization role users + + Get the number of users that have a given role within a specific organization.
read:organization_user_roles
+ + :param org_code: The organization's code. (required) + :type org_code: str + :param role_id: The role's public id. (required) + :type role_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_organization_role_users_count_serialize( + org_code=org_code, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetOrganizationRoleUsersCountResponse", + '400': "ErrorResponse", + '403': None, + '429': 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, @@ -7545,12 +8190,10 @@ def get_organization_role_users_with_http_info( @validate_call - def get_organization_role_users_without_preload_content( + def get_organization_role_users_count_without_preload_content( self, org_code: Annotated[StrictStr, Field(description="The organization's code.")], role_id: Annotated[StrictStr, Field(description="The role's public id.")], - page_size: Annotated[Optional[StrictInt], Field(description="Number of results per page. Defaults to 10 if parameter not sent.")] = None, - next_token: Annotated[Optional[StrictStr], Field(description="A string to get the next page of results if there are more results.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7564,18 +8207,14 @@ def get_organization_role_users_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List organization role users + """Count organization role users - Get users that have a given role within a specific organization.
read:organization_user_roles
+ Get the number of users that have a given role within a specific organization.
read:organization_user_roles
:param org_code: The organization's code. (required) :type org_code: str :param role_id: The role's public id. (required) :type role_id: str - :param page_size: Number of results per page. Defaults to 10 if parameter not sent. - :type page_size: int - :param next_token: A string to get the next page of results if there are more results. - :type next_token: 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 @@ -7598,11 +8237,9 @@ def get_organization_role_users_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_organization_role_users_serialize( + _param = self._get_organization_role_users_count_serialize( org_code=org_code, role_id=role_id, - page_size=page_size, - next_token=next_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7610,7 +8247,7 @@ def get_organization_role_users_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetOrganizationRoleUsersResponse", + '200': "GetOrganizationRoleUsersCountResponse", '400': "ErrorResponse", '403': None, '429': None, @@ -7622,12 +8259,10 @@ def get_organization_role_users_without_preload_content( return response_data.response - def _get_organization_role_users_serialize( + def _get_organization_role_users_count_serialize( self, org_code, role_id, - page_size, - next_token, _request_auth, _content_type, _headers, @@ -7654,14 +8289,6 @@ def _get_organization_role_users_serialize( if role_id is not None: _path_params['role_id'] = role_id # process the query parameters - if page_size is not None: - - _query_params.append(('page_size', page_size)) - - if next_token is not None: - - _query_params.append(('next_token', next_token)) - # process the header parameters # process the form parameters # process the body parameter @@ -7684,7 +8311,7 @@ def _get_organization_role_users_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/organizations/{org_code}/roles/{role_id}/users', + resource_path='/api/v1/organizations/{org_code}/roles/{role_id}/users/count', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10695,7 +11322,7 @@ def update_organization( ) -> SuccessResponse: """Update Organization - Update an organization.
update:organizations
+ Update an organization. When the organization name is updated and the organization is a billing customer, the change is also propagated to the corresponding billing customer details.
update:organizations
:param org_code: The identifier for the organization. (required) :type org_code: str @@ -10773,7 +11400,7 @@ def update_organization_with_http_info( ) -> ApiResponse[SuccessResponse]: """Update Organization - Update an organization.
update:organizations
+ Update an organization. When the organization name is updated and the organization is a billing customer, the change is also propagated to the corresponding billing customer details.
update:organizations
:param org_code: The identifier for the organization. (required) :type org_code: str @@ -10851,7 +11478,7 @@ def update_organization_without_preload_content( ) -> RESTResponseType: """Update Organization - Update an organization.
update:organizations
+ Update an organization. When the organization name is updated and the organization is a billing customer, the change is also propagated to the corresponding billing customer details.
update:organizations
:param org_code: The identifier for the organization. (required) :type org_code: str diff --git a/kinde_sdk/management/api/users_api.py b/kinde_sdk/management/api/users_api.py index f7f0a23c..3b049be7 100644 --- a/kinde_sdk/management/api/users_api.py +++ b/kinde_sdk/management/api/users_api.py @@ -22,6 +22,8 @@ from typing import Optional from typing_extensions import Annotated from kinde_sdk.management.models.create_identity_response import CreateIdentityResponse +from kinde_sdk.management.models.create_user_billing_customer_request import CreateUserBillingCustomerRequest +from kinde_sdk.management.models.create_user_billing_customer_response import CreateUserBillingCustomerResponse from kinde_sdk.management.models.create_user_identity_request import CreateUserIdentityRequest from kinde_sdk.management.models.create_user_request import CreateUserRequest from kinde_sdk.management.models.create_user_response import CreateUserResponse @@ -338,6 +340,305 @@ def _create_user_serialize( + @validate_call + def create_user_billing_customer( + self, + user_id: Annotated[StrictStr, Field(description="The user's ID.")], + create_user_billing_customer_request: Annotated[CreateUserBillingCustomerRequest, Field(description="Billing customer details.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateUserBillingCustomerResponse: + """Create user billing customer + + Creates a billing customer for a user in an organization, and assigns a published user billing plan. This mirrors the admin \"Start billing customer\" action on the user billing page. At most one billing customer is created per user in an organization. If one already exists, the request fails with `BILLING_CUSTOMER_EXISTS`. Concurrent creates that both pass the existence check before either finishes may both return success with the same customer and agreement ids (onboarding reuses the row created under the advisory lock).
create:user_billing_customers
+ + :param user_id: The user's ID. (required) + :type user_id: str + :param create_user_billing_customer_request: Billing customer details. (required) + :type create_user_billing_customer_request: CreateUserBillingCustomerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_billing_customer_serialize( + user_id=user_id, + create_user_billing_customer_request=create_user_billing_customer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateUserBillingCustomerResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_billing_customer_with_http_info( + self, + user_id: Annotated[StrictStr, Field(description="The user's ID.")], + create_user_billing_customer_request: Annotated[CreateUserBillingCustomerRequest, Field(description="Billing customer details.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[CreateUserBillingCustomerResponse]: + """Create user billing customer + + Creates a billing customer for a user in an organization, and assigns a published user billing plan. This mirrors the admin \"Start billing customer\" action on the user billing page. At most one billing customer is created per user in an organization. If one already exists, the request fails with `BILLING_CUSTOMER_EXISTS`. Concurrent creates that both pass the existence check before either finishes may both return success with the same customer and agreement ids (onboarding reuses the row created under the advisory lock).
create:user_billing_customers
+ + :param user_id: The user's ID. (required) + :type user_id: str + :param create_user_billing_customer_request: Billing customer details. (required) + :type create_user_billing_customer_request: CreateUserBillingCustomerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_billing_customer_serialize( + user_id=user_id, + create_user_billing_customer_request=create_user_billing_customer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateUserBillingCustomerResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_billing_customer_without_preload_content( + self, + user_id: Annotated[StrictStr, Field(description="The user's ID.")], + create_user_billing_customer_request: Annotated[CreateUserBillingCustomerRequest, Field(description="Billing customer details.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 billing customer + + Creates a billing customer for a user in an organization, and assigns a published user billing plan. This mirrors the admin \"Start billing customer\" action on the user billing page. At most one billing customer is created per user in an organization. If one already exists, the request fails with `BILLING_CUSTOMER_EXISTS`. Concurrent creates that both pass the existence check before either finishes may both return success with the same customer and agreement ids (onboarding reuses the row created under the advisory lock).
create:user_billing_customers
+ + :param user_id: The user's ID. (required) + :type user_id: str + :param create_user_billing_customer_request: Billing customer details. (required) + :type create_user_billing_customer_request: CreateUserBillingCustomerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_billing_customer_serialize( + user_id=user_id, + create_user_billing_customer_request=create_user_billing_customer_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateUserBillingCustomerResponse", + '400': "ErrorResponse", + '403': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_user_billing_customer_serialize( + self, + user_id, + create_user_billing_customer_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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['user_id'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_user_billing_customer_request is not None: + _body_params = create_user_billing_customer_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/json; charset=utf-8' + ] + ) + + # 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] = [ + 'kindeBearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/users/{user_id}/billing_customer', + 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 create_user_identity( self, @@ -4178,7 +4479,7 @@ def update_user( ) -> UpdateUserResponse: """Update user - Update a user record.
update:users
+ Update a user record. When `given_name` or `family_name` is updated and the user is the owner of a family billing customer, the change is also propagated to the corresponding billing customer details.
update:users
:param id: The user's id. (required) :type id: str @@ -4252,7 +4553,7 @@ def update_user_with_http_info( ) -> ApiResponse[UpdateUserResponse]: """Update user - Update a user record.
update:users
+ Update a user record. When `given_name` or `family_name` is updated and the user is the owner of a family billing customer, the change is also propagated to the corresponding billing customer details.
update:users
:param id: The user's id. (required) :type id: str @@ -4326,7 +4627,7 @@ def update_user_without_preload_content( ) -> RESTResponseType: """Update user - Update a user record.
update:users
+ Update a user record. When `given_name` or `family_name` is updated and the user is the owner of a family billing customer, the change is also propagated to the corresponding billing customer details.
update:users
:param id: The user's id. (required) :type id: str diff --git a/kinde_sdk/management/api_client.py b/kinde_sdk/management/api_client.py index e659e104..64cf1100 100644 --- a/kinde_sdk/management/api_client.py +++ b/kinde_sdk/management/api_client.py @@ -92,7 +92,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/2.3.0/python' + self.user_agent = 'OpenAPI-Generator/2.3.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/kinde_sdk/management/configuration.py b/kinde_sdk/management/configuration.py index f8147763..caaf1822 100644 --- a/kinde_sdk/management/configuration.py +++ b/kinde_sdk/management/configuration.py @@ -517,7 +517,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1\n"\ - "SDK Package Version: 2.3.0".\ + "SDK Package Version: 2.3.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/kinde_sdk/management/models/__init__.py b/kinde_sdk/management/models/__init__.py index 458ec1b9..c9bb3cbe 100644 --- a/kinde_sdk/management/models/__init__.py +++ b/kinde_sdk/management/models/__init__.py @@ -22,6 +22,7 @@ from kinde_sdk.management.models.add_role_scope_request import AddRoleScopeRequest from kinde_sdk.management.models.add_role_scope_response import AddRoleScopeResponse from kinde_sdk.management.models.api_result import ApiResult +from kinde_sdk.management.models.application_access_role import ApplicationAccessRole from kinde_sdk.management.models.applications import Applications from kinde_sdk.management.models.authorize_app_api_response import AuthorizeAppApiResponse from kinde_sdk.management.models.category import Category @@ -77,6 +78,9 @@ from kinde_sdk.management.models.create_roles_response_role import CreateRolesResponseRole from kinde_sdk.management.models.create_subscriber_success_response import CreateSubscriberSuccessResponse from kinde_sdk.management.models.create_subscriber_success_response_subscriber import CreateSubscriberSuccessResponseSubscriber +from kinde_sdk.management.models.create_user_billing_customer_request import CreateUserBillingCustomerRequest +from kinde_sdk.management.models.create_user_billing_customer_response import CreateUserBillingCustomerResponse +from kinde_sdk.management.models.create_user_billing_customer_response_billing_customer import CreateUserBillingCustomerResponseBillingCustomer from kinde_sdk.management.models.create_user_identity_request import CreateUserIdentityRequest from kinde_sdk.management.models.create_user_request import CreateUserRequest from kinde_sdk.management.models.create_user_request_identities_inner import CreateUserRequestIdentitiesInner @@ -110,6 +114,7 @@ from kinde_sdk.management.models.get_apis_response import GetApisResponse from kinde_sdk.management.models.get_apis_response_apis_inner import GetApisResponseApisInner from kinde_sdk.management.models.get_apis_response_apis_inner_scopes_inner import GetApisResponseApisInnerScopesInner +from kinde_sdk.management.models.get_application_access_roles_response import GetApplicationAccessRolesResponse from kinde_sdk.management.models.get_application_response import GetApplicationResponse from kinde_sdk.management.models.get_application_response_application import GetApplicationResponseApplication from kinde_sdk.management.models.get_applications_response import GetApplicationsResponse @@ -147,6 +152,8 @@ from kinde_sdk.management.models.get_organization_response import GetOrganizationResponse from kinde_sdk.management.models.get_organization_response_billing import GetOrganizationResponseBilling from kinde_sdk.management.models.get_organization_response_billing_agreements_inner import GetOrganizationResponseBillingAgreementsInner +from kinde_sdk.management.models.get_organization_role_active_users_count_response import GetOrganizationRoleActiveUsersCountResponse +from kinde_sdk.management.models.get_organization_role_users_count_response import GetOrganizationRoleUsersCountResponse from kinde_sdk.management.models.get_organization_role_users_response import GetOrganizationRoleUsersResponse from kinde_sdk.management.models.get_organization_role_users_response_users_inner import GetOrganizationRoleUsersResponseUsersInner from kinde_sdk.management.models.get_organization_users_response import GetOrganizationUsersResponse diff --git a/kinde_sdk/management/models/application_access_role.py b/kinde_sdk/management/models/application_access_role.py new file mode 100644 index 00000000..d3e61333 --- /dev/null +++ b/kinde_sdk/management/models/application_access_role.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +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 ApplicationAccessRole(BaseModel): + """ + A business role configured as allowed to access an application. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The role's ID.") + key: Optional[StrictStr] = Field(default=None, description="The role identifier to use in code.") + name: Optional[StrictStr] = Field(default=None, description="The role's name.") + description: Optional[StrictStr] = Field(default=None, description="The role's description.") + __properties: ClassVar[List[str]] = ["id", "key", "name", "description"] + + 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.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) -> Optional[Self]: + """Create an instance of ApplicationAccessRole from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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 description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApplicationAccessRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "key": obj.get("key"), + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/kinde_sdk/management/models/create_connection_request_options_one_of2.py b/kinde_sdk/management/models/create_connection_request_options_one_of2.py index be1c82f9..b0aa9f5d 100644 --- a/kinde_sdk/management/models/create_connection_request_options_one_of2.py +++ b/kinde_sdk/management/models/create_connection_request_options_one_of2.py @@ -29,7 +29,8 @@ class CreateConnectionRequestOptionsOneOf2(BaseModel): """ # noqa: E501 home_realm_domains: Optional[List[StrictStr]] = Field(default=None, description="List of domains to restrict authentication.") saml_entity_id: Optional[StrictStr] = Field(default=None, description="SAML Entity ID.") - saml_idp_metadata_url: Optional[StrictStr] = Field(default=None, description="URL for the IdP metadata.") + saml_idp_metadata_url: Optional[StrictStr] = Field(default=None, description="URL for the IdP metadata. Optional if saml_idp_metadata_xml is provided.") + saml_idp_metadata_xml: Optional[StrictStr] = Field(default=None, description="Raw IdP metadata XML. Use when the IdP does not host a metadata URL (e.g. Google Workspace). Takes precedence over saml_idp_metadata_url when both are set.") saml_sign_in_url: Optional[StrictStr] = Field(default=None, description="Override the default SSO endpoint with a URL your IdP recognizes.") sign_request_algorithm: Optional[StrictStr] = Field(default=None, description="Algorithm used to sign SAML requests.") protocol_binding: Optional[StrictStr] = Field(default=None, description="Protocol binding used to send SAML requests.") @@ -46,7 +47,7 @@ class CreateConnectionRequestOptionsOneOf2(BaseModel): is_auto_join_organization_enabled: Optional[StrictBool] = Field(default=None, description="Users automatically join organization when using this connection.") is_use_custom_domain: Optional[StrictBool] = Field(default=None, description="Use custom domain callback URL.") is_trusted: Optional[StrictBool] = Field(default=None, description="Trust this connection for account merging.") - __properties: ClassVar[List[str]] = ["home_realm_domains", "saml_entity_id", "saml_idp_metadata_url", "saml_sign_in_url", "sign_request_algorithm", "protocol_binding", "name_id_format", "saml_email_key_attr", "saml_user_id_key_attr", "saml_first_name_key_attr", "saml_last_name_key_attr", "is_create_missing_user", "is_force_show_sso_button", "upstream_params", "saml_signing_certificate", "saml_signing_private_key", "is_auto_join_organization_enabled", "is_use_custom_domain", "is_trusted"] + __properties: ClassVar[List[str]] = ["home_realm_domains", "saml_entity_id", "saml_idp_metadata_url", "saml_idp_metadata_xml", "saml_sign_in_url", "sign_request_algorithm", "protocol_binding", "name_id_format", "saml_email_key_attr", "saml_user_id_key_attr", "saml_first_name_key_attr", "saml_last_name_key_attr", "is_create_missing_user", "is_force_show_sso_button", "upstream_params", "saml_signing_certificate", "saml_signing_private_key", "is_auto_join_organization_enabled", "is_use_custom_domain", "is_trusted"] @field_validator('sign_request_algorithm') def sign_request_algorithm_validate_enum(cls, value): @@ -132,6 +133,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "home_realm_domains": obj.get("home_realm_domains"), "saml_entity_id": obj.get("saml_entity_id"), "saml_idp_metadata_url": obj.get("saml_idp_metadata_url"), + "saml_idp_metadata_xml": obj.get("saml_idp_metadata_xml"), "saml_sign_in_url": obj.get("saml_sign_in_url"), "sign_request_algorithm": obj.get("sign_request_algorithm"), "protocol_binding": obj.get("protocol_binding"), diff --git a/kinde_sdk/management/models/create_directory_request.py b/kinde_sdk/management/models/create_directory_request.py index 267905fb..b0cdd29b 100644 --- a/kinde_sdk/management/models/create_directory_request.py +++ b/kinde_sdk/management/models/create_directory_request.py @@ -28,14 +28,17 @@ class CreateDirectoryRequest(BaseModel): CreateDirectoryRequest """ # noqa: E501 org_code: StrictStr = Field(description="The organization code to create the SCIM directory for.") - directory_name: StrictStr = Field(description="A descriptive name for the SCIM directory.") - provider_code: StrictStr = Field(description="The SCIM provider code to use for this directory.") + directory_name: Optional[StrictStr] = Field(default=None, description="An optional descriptive name for the SCIM directory.") + provider_code: Optional[StrictStr] = Field(default=None, description="The SCIM provider code to use for this directory. When omitted, the provider is inferred from the organization enterprise authentication method. If the inferred (or explicit) provider is disabled or missing endpoint configuration, INVALID_PROVIDER is returned. ") enterprise_connection_id: Optional[StrictStr] = Field(default=None, description="The enterprise connection ID to associate with this directory for SCIM-provisioned users. Required when the organization has multiple enabled enterprise connections. ") __properties: ClassVar[List[str]] = ["org_code", "directory_name", "provider_code", "enterprise_connection_id"] @field_validator('provider_code') def provider_code_validate_enum(cls, value): """Validates the enum""" + if value is None: + return value + if value not in set(['entra_id_azure_ad', 'okta', 'google_workspace', 'custom_scim_v2', 'cyberark', 'jumpcloud', 'onelogin', 'pingfederate', 'rippling']): raise ValueError("must be one of enum values ('entra_id_azure_ad', 'okta', 'google_workspace', 'custom_scim_v2', 'cyberark', 'jumpcloud', 'onelogin', 'pingfederate', 'rippling')") return value diff --git a/kinde_sdk/management/models/create_organization_request.py b/kinde_sdk/management/models/create_organization_request.py index 80c1f945..8641a120 100644 --- a/kinde_sdk/management/models/create_organization_request.py +++ b/kinde_sdk/management/models/create_organization_request.py @@ -44,9 +44,9 @@ class CreateOrganizationRequest(BaseModel): is_auto_membership_enabled: Optional[StrictBool] = Field(default=None, description="If users become members of this organization when the org code is supplied during authentication.") sender_name: Optional[StrictStr] = Field(default=None, description="The name of the organization that will be used in emails") sender_email: Optional[StrictStr] = Field(default=None, description="The email address that will be used in emails. Requires custom SMTP to be set up.") - is_create_billing_customer: Optional[StrictBool] = Field(default=None, description="If a billing customer is also created for this organization") - billing_email: Optional[StrictStr] = Field(default=None, description="The email address used for billing purposes for the organization") - billing_plan_code: Optional[StrictStr] = Field(default=None, description="The billing plan to put the customer on. If not specified, the default plan is used") + is_create_billing_customer: Optional[StrictBool] = Field(default=None, description="If an organization billing customer is also created for this organization") + billing_email: Optional[StrictStr] = Field(default=None, description="The email address used for billing purposes for the organization. Required when is_create_billing_customer is true") + billing_plan_code: Optional[StrictStr] = Field(default=None, description="Code of a published organization billing plan to assign to the new billing customer. If omitted, the default organization plan is used. User plans and unpublished plans are rejected. ") __properties: ClassVar[List[str]] = ["name", "feature_flags", "external_id", "background_color", "button_color", "button_text_color", "link_color", "background_color_dark", "button_color_dark", "button_text_color_dark", "link_color_dark", "theme_code", "handle", "is_allow_registrations", "is_auto_membership_enabled", "sender_name", "sender_email", "is_create_billing_customer", "billing_email", "billing_plan_code"] @field_validator('feature_flags') diff --git a/kinde_sdk/management/models/create_user_billing_customer_request.py b/kinde_sdk/management/models/create_user_billing_customer_request.py new file mode 100644 index 00000000..140567fe --- /dev/null +++ b/kinde_sdk/management/models/create_user_billing_customer_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +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 CreateUserBillingCustomerRequest(BaseModel): + """ + CreateUserBillingCustomerRequest + """ # noqa: E501 + org_code: StrictStr = Field(description="The organization code the user belongs to. The billing customer is linked to this organization.") + billing_email: StrictStr = Field(description="The email address used for billing purposes for the user.") + billing_plan_code: Optional[StrictStr] = Field(default=None, description="Code of a published user billing plan to assign to the new billing customer. If omitted, the default user plan is used. Organization plans and unpublished plans are rejected. ") + __properties: ClassVar[List[str]] = ["org_code", "billing_email", "billing_plan_code"] + + 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.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) -> Optional[Self]: + """Create an instance of CreateUserBillingCustomerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateUserBillingCustomerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "org_code": obj.get("org_code"), + "billing_email": obj.get("billing_email"), + "billing_plan_code": obj.get("billing_plan_code") + }) + return _obj + + diff --git a/kinde_sdk/management/models/create_user_billing_customer_response.py b/kinde_sdk/management/models/create_user_billing_customer_response.py new file mode 100644 index 00000000..3272f8af --- /dev/null +++ b/kinde_sdk/management/models/create_user_billing_customer_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from kinde_sdk.management.models.create_user_billing_customer_response_billing_customer import CreateUserBillingCustomerResponseBillingCustomer +from typing import Optional, Set +from typing_extensions import Self + +class CreateUserBillingCustomerResponse(BaseModel): + """ + CreateUserBillingCustomerResponse + """ # noqa: E501 + message: Optional[StrictStr] = Field(default=None, description="Response message.") + code: Optional[StrictStr] = Field(default=None, description="Response code.") + billing_customer: Optional[CreateUserBillingCustomerResponseBillingCustomer] = None + __properties: ClassVar[List[str]] = ["message", "code", "billing_customer"] + + 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.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) -> Optional[Self]: + """Create an instance of CreateUserBillingCustomerResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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 billing_customer + if self.billing_customer: + _dict['billing_customer'] = self.billing_customer.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateUserBillingCustomerResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message"), + "code": obj.get("code"), + "billing_customer": CreateUserBillingCustomerResponseBillingCustomer.from_dict(obj["billing_customer"]) if obj.get("billing_customer") is not None else None + }) + return _obj + + diff --git a/kinde_sdk/management/models/create_user_billing_customer_response_billing_customer.py b/kinde_sdk/management/models/create_user_billing_customer_response_billing_customer.py new file mode 100644 index 00000000..43376232 --- /dev/null +++ b/kinde_sdk/management/models/create_user_billing_customer_response_billing_customer.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +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 CreateUserBillingCustomerResponseBillingCustomer(BaseModel): + """ + CreateUserBillingCustomerResponseBillingCustomer + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The billing customer id.") + agreement_id: Optional[StrictStr] = Field(default=None, description="The billing agreement id created for the assigned plan.") + __properties: ClassVar[List[str]] = ["id", "agreement_id"] + + 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.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) -> Optional[Self]: + """Create an instance of CreateUserBillingCustomerResponseBillingCustomer from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateUserBillingCustomerResponseBillingCustomer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "agreement_id": obj.get("agreement_id") + }) + return _obj + + diff --git a/kinde_sdk/management/models/get_application_access_roles_response.py b/kinde_sdk/management/models/get_application_access_roles_response.py new file mode 100644 index 00000000..6487e8d9 --- /dev/null +++ b/kinde_sdk/management/models/get_application_access_roles_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from kinde_sdk.management.models.application_access_role import ApplicationAccessRole +from typing import Optional, Set +from typing_extensions import Self + +class GetApplicationAccessRolesResponse(BaseModel): + """ + GetApplicationAccessRolesResponse + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="Response code.") + message: Optional[StrictStr] = Field(default=None, description="Response message.") + roles: Optional[List[ApplicationAccessRole]] = Field(default=None, description="Roles configured as allowed to access the application.") + has_more: Optional[StrictBool] = Field(default=None, description="Whether more records exist.") + __properties: ClassVar[List[str]] = ["code", "message", "roles", "has_more"] + + 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.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) -> Optional[Self]: + """Create an instance of GetApplicationAccessRolesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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 roles (list) + _items = [] + if self.roles: + for _item_roles in self.roles: + if _item_roles: + _items.append(_item_roles.to_dict()) + _dict['roles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetApplicationAccessRolesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "roles": [ApplicationAccessRole.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None, + "has_more": obj.get("has_more") + }) + return _obj + + diff --git a/kinde_sdk/management/models/get_application_response_application.py b/kinde_sdk/management/models/get_application_response_application.py index cac45b67..410c0f16 100644 --- a/kinde_sdk/management/models/get_application_response_application.py +++ b/kinde_sdk/management/models/get_application_response_application.py @@ -35,7 +35,15 @@ class GetApplicationResponseApplication(BaseModel): login_uri: Optional[StrictStr] = Field(default=None, description="The default login route for resolving session issues.") homepage_uri: Optional[StrictStr] = Field(default=None, description="The homepage link to your application.") has_cancel_button: Optional[StrictBool] = Field(default=None, description="Whether the application has a cancel button to allow users to exit the auth flow [Beta].") - __properties: ClassVar[List[str]] = ["id", "name", "type", "client_id", "client_secret", "login_uri", "homepage_uri", "has_cancel_button"] + is_access_control_enabled: Optional[StrictBool] = Field(default=None, description="Whether role-based access control is enforced for the application. Always false for application types that do not support connections. ") + is_allow_faceless_auth: Optional[StrictBool] = Field(default=None, description="Bypass Kinde's sign up and sign in screens and use your own design.") + is_ask_for_name: Optional[StrictBool] = Field(default=None, description="Show fields to collect name details from users signing up with email or phone.") + has_marketing_consent: Optional[StrictBool] = Field(default=None, description="Show a marketing consent checkbox on the sign-up page.") + has_sign_in_link_on_sign_up_page: Optional[StrictBool] = Field(default=None, description="Allow users to switch to the login page from the sign-up page.") + has_register_link_on_sign_in_page: Optional[StrictBool] = Field(default=None, description="Allow users to switch to the register page from the sign-in page.") + has_sign_in_with_sso_button: Optional[StrictBool] = Field(default=None, description="When home realm discovery is configured, users see a button to prompt them to use their work email.") + use_gravatar_fallback: Optional[StrictBool] = Field(default=None, description="Use a backup image if a profile picture is not available.") + __properties: ClassVar[List[str]] = ["id", "name", "type", "client_id", "client_secret", "login_uri", "homepage_uri", "has_cancel_button", "is_access_control_enabled", "is_allow_faceless_auth", "is_ask_for_name", "has_marketing_consent", "has_sign_in_link_on_sign_up_page", "has_register_link_on_sign_in_page", "has_sign_in_with_sso_button", "use_gravatar_fallback"] @field_validator('type') def type_validate_enum(cls, value): @@ -43,8 +51,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['m2m', 'reg', 'spa']): - raise ValueError("must be one of enum values ('m2m', 'reg', 'spa')") + if value not in set(['m2m', 'reg', 'spa', 'device']): + raise ValueError("must be one of enum values ('m2m', 'reg', 'spa', 'device')") return value model_config = ConfigDict( @@ -105,7 +113,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "client_secret": obj.get("client_secret"), "login_uri": obj.get("login_uri"), "homepage_uri": obj.get("homepage_uri"), - "has_cancel_button": obj.get("has_cancel_button") + "has_cancel_button": obj.get("has_cancel_button"), + "is_access_control_enabled": obj.get("is_access_control_enabled"), + "is_allow_faceless_auth": obj.get("is_allow_faceless_auth"), + "is_ask_for_name": obj.get("is_ask_for_name"), + "has_marketing_consent": obj.get("has_marketing_consent"), + "has_sign_in_link_on_sign_up_page": obj.get("has_sign_in_link_on_sign_up_page"), + "has_register_link_on_sign_in_page": obj.get("has_register_link_on_sign_in_page"), + "has_sign_in_with_sso_button": obj.get("has_sign_in_with_sso_button"), + "use_gravatar_fallback": obj.get("use_gravatar_fallback") }) return _obj diff --git a/kinde_sdk/management/models/get_billing_agreements_response_agreements_inner.py b/kinde_sdk/management/models/get_billing_agreements_response_agreements_inner.py index b1d8bc6e..1038c501 100644 --- a/kinde_sdk/management/models/get_billing_agreements_response_agreements_inner.py +++ b/kinde_sdk/management/models/get_billing_agreements_response_agreements_inner.py @@ -33,8 +33,10 @@ class GetBillingAgreementsResponseAgreementsInner(BaseModel): plan_code: Optional[StrictStr] = Field(default=None, description="The plan code the billing customer is subscribed to") expires_on: Optional[datetime] = Field(default=None, description="The date the agreement expired (and was no longer active)") billing_group_id: Optional[StrictStr] = Field(default=None, description="The friendly id of the billing group this agreement's plan is part of") + current_period_start: Optional[datetime] = Field(default=None, description="The start date of the agreement's current billing period. Null when the agreement has no current billing cycle. ") + current_period_end: Optional[datetime] = Field(default=None, description="The end date of the agreement's current billing period (typically the next billing date). Null when the agreement has no current billing cycle; may be in the past if cycle roll or provider sync has lagged. ") entitlements: Optional[List[GetBillingAgreementsResponseAgreementsInnerEntitlementsInner]] = Field(default=None, description="A list of billing entitlements that is part of this agreement") - __properties: ClassVar[List[str]] = ["id", "plan_code", "expires_on", "billing_group_id", "entitlements"] + __properties: ClassVar[List[str]] = ["id", "plan_code", "expires_on", "billing_group_id", "current_period_start", "current_period_end", "entitlements"] model_config = ConfigDict( populate_by_name=True, @@ -82,6 +84,26 @@ def to_dict(self) -> Dict[str, Any]: if _item_entitlements: _items.append(_item_entitlements.to_dict()) _dict['entitlements'] = _items + # set to None if expires_on (nullable) is None + # and model_fields_set contains the field + if self.expires_on is None and "expires_on" in self.model_fields_set: + _dict['expires_on'] = None + + # set to None if billing_group_id (nullable) is None + # and model_fields_set contains the field + if self.billing_group_id is None and "billing_group_id" in self.model_fields_set: + _dict['billing_group_id'] = None + + # set to None if current_period_start (nullable) is None + # and model_fields_set contains the field + if self.current_period_start is None and "current_period_start" in self.model_fields_set: + _dict['current_period_start'] = None + + # set to None if current_period_end (nullable) is None + # and model_fields_set contains the field + if self.current_period_end is None and "current_period_end" in self.model_fields_set: + _dict['current_period_end'] = None + return _dict @classmethod @@ -98,6 +120,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "plan_code": obj.get("plan_code"), "expires_on": obj.get("expires_on"), "billing_group_id": obj.get("billing_group_id"), + "current_period_start": obj.get("current_period_start"), + "current_period_end": obj.get("current_period_end"), "entitlements": [GetBillingAgreementsResponseAgreementsInnerEntitlementsInner.from_dict(_item) for _item in obj["entitlements"]] if obj.get("entitlements") is not None else None }) return _obj diff --git a/kinde_sdk/management/models/get_organization_role_active_users_count_response.py b/kinde_sdk/management/models/get_organization_role_active_users_count_response.py new file mode 100644 index 00000000..47f261cb --- /dev/null +++ b/kinde_sdk/management/models/get_organization_role_active_users_count_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +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 GetOrganizationRoleActiveUsersCountResponse(BaseModel): + """ + GetOrganizationRoleActiveUsersCountResponse + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="Response code.") + message: Optional[StrictStr] = Field(default=None, description="Response message.") + active_users_count: Optional[StrictInt] = Field(default=None, description="Number of users with the role who received at least one access token during the requested period.") + date_time_from: Optional[datetime] = Field(default=None, description="Start of the active period that was used (inclusive), in UTC at second precision after any rounding.") + date_time_to: Optional[datetime] = Field(default=None, description="End of the active period that was used (inclusive), in UTC at second precision after any rounding.") + __properties: ClassVar[List[str]] = ["code", "message", "active_users_count", "date_time_from", "date_time_to"] + + 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.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) -> Optional[Self]: + """Create an instance of GetOrganizationRoleActiveUsersCountResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetOrganizationRoleActiveUsersCountResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "active_users_count": obj.get("active_users_count"), + "date_time_from": obj.get("date_time_from"), + "date_time_to": obj.get("date_time_to") + }) + return _obj + + diff --git a/kinde_sdk/management/models/get_organization_role_users_count_response.py b/kinde_sdk/management/models/get_organization_role_users_count_response.py new file mode 100644 index 00000000..597bddb0 --- /dev/null +++ b/kinde_sdk/management/models/get_organization_role_users_count_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Kinde Management API + + Provides endpoints to manage your Kinde Businesses. ## Intro ## How to use 1. [Set up and authorize a machine-to-machine (M2M) application](https://docs.kinde.com/developer-tools/kinde-api/connect-to-kinde-api/). 2. [Generate a test access token](https://docs.kinde.com/developer-tools/kinde-api/access-token-for-api/) 3. Test request any endpoint using the test token + + The version of the OpenAPI document: 1 + Contact: support@kinde.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +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 GetOrganizationRoleUsersCountResponse(BaseModel): + """ + GetOrganizationRoleUsersCountResponse + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="Response code.") + message: Optional[StrictStr] = Field(default=None, description="Response message.") + count: Optional[StrictInt] = Field(default=None, description="The number of users with the specified role in the organization.") + __properties: ClassVar[List[str]] = ["code", "message", "count"] + + 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.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) -> Optional[Self]: + """Create an instance of GetOrganizationRoleUsersCountResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetOrganizationRoleUsersCountResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "count": obj.get("count") + }) + return _obj + + diff --git a/kinde_sdk/management/models/replace_connection_request_options_one_of1.py b/kinde_sdk/management/models/replace_connection_request_options_one_of1.py index 92c51e29..5fbd8805 100644 --- a/kinde_sdk/management/models/replace_connection_request_options_one_of1.py +++ b/kinde_sdk/management/models/replace_connection_request_options_one_of1.py @@ -29,7 +29,8 @@ class ReplaceConnectionRequestOptionsOneOf1(BaseModel): """ # noqa: E501 home_realm_domains: Optional[List[StrictStr]] = Field(default=None, description="List of domains to restrict authentication.") saml_entity_id: Optional[StrictStr] = Field(default=None, description="SAML Entity ID.") - saml_idp_metadata_url: Optional[StrictStr] = Field(default=None, description="URL for the IdP metadata.") + saml_idp_metadata_url: Optional[StrictStr] = Field(default=None, description="URL for the IdP metadata. Optional if saml_idp_metadata_xml is provided.") + saml_idp_metadata_xml: Optional[StrictStr] = Field(default=None, description="Raw IdP metadata XML. Use when the IdP does not host a metadata URL (e.g. Google Workspace). Takes precedence over saml_idp_metadata_url when both are set.") sign_request_algorithm: Optional[StrictStr] = Field(default=None, description="Algorithm used to sign SAML requests.") protocol_binding: Optional[StrictStr] = Field(default=None, description="Protocol binding used to send SAML requests.") name_id_format: Optional[StrictStr] = Field(default=None, description="Format for the Name ID used to identify users in SAML responses.") @@ -44,7 +45,7 @@ class ReplaceConnectionRequestOptionsOneOf1(BaseModel): saml_signing_private_key: Optional[StrictStr] = Field(default=None, description="Private key associated with the signing certificate.") is_use_custom_domain: Optional[StrictBool] = Field(default=None, description="Use custom domain callback URL.") is_trusted: Optional[StrictBool] = Field(default=None, description="Trust this connection for account merging.") - __properties: ClassVar[List[str]] = ["home_realm_domains", "saml_entity_id", "saml_idp_metadata_url", "sign_request_algorithm", "protocol_binding", "name_id_format", "saml_email_key_attr", "saml_user_id_key_attr", "saml_first_name_key_attr", "saml_last_name_key_attr", "is_create_missing_user", "is_force_show_sso_button", "upstream_params", "saml_signing_certificate", "saml_signing_private_key", "is_use_custom_domain", "is_trusted"] + __properties: ClassVar[List[str]] = ["home_realm_domains", "saml_entity_id", "saml_idp_metadata_url", "saml_idp_metadata_xml", "sign_request_algorithm", "protocol_binding", "name_id_format", "saml_email_key_attr", "saml_user_id_key_attr", "saml_first_name_key_attr", "saml_last_name_key_attr", "is_create_missing_user", "is_force_show_sso_button", "upstream_params", "saml_signing_certificate", "saml_signing_private_key", "is_use_custom_domain", "is_trusted"] @field_validator('sign_request_algorithm') def sign_request_algorithm_validate_enum(cls, value): @@ -130,6 +131,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "home_realm_domains": obj.get("home_realm_domains"), "saml_entity_id": obj.get("saml_entity_id"), "saml_idp_metadata_url": obj.get("saml_idp_metadata_url"), + "saml_idp_metadata_xml": obj.get("saml_idp_metadata_xml"), "sign_request_algorithm": obj.get("sign_request_algorithm"), "protocol_binding": obj.get("protocol_binding"), "name_id_format": obj.get("name_id_format"), diff --git a/kinde_sdk/management/models/set_user_password_request.py b/kinde_sdk/management/models/set_user_password_request.py index f8da3e04..dec4968f 100644 --- a/kinde_sdk/management/models/set_user_password_request.py +++ b/kinde_sdk/management/models/set_user_password_request.py @@ -27,14 +27,18 @@ class SetUserPasswordRequest(BaseModel): """ SetUserPasswordRequest """ # noqa: E501 - hashed_password: StrictStr = Field(description="The hashed password.") + hashed_password: StrictStr = Field(description="The hashed password. For aspnet-identity-v2, provide the base64-encoded AspNetUsers.PasswordHash value as-is.") hashing_method: Optional[StrictStr] = Field(default=None, description="The hashing method or algorithm used to encrypt the user’s password. Default is bcrypt.") - salt: Optional[StrictStr] = Field(default=None, description="Extra characters added to passwords to make them stronger. Not required for bcrypt. Required for pbkdf2; provide the base64-encoded salt.") + salt: Optional[StrictStr] = Field(default=None, description="Extra characters added to passwords to make them stronger. Not required for bcrypt. Required for pbkdf2; provide the base64-encoded salt. Required for firebase-scrypt; provide the base64-encoded per-user salt. Not used for aspnet-identity-v2 (the salt is embedded in the hash); do not provide salt, salt_position, iterations, or variant with aspnet-identity-v2.") salt_position: Optional[StrictStr] = Field(default=None, description="Position of salt in password string. Not required for bcrypt.") - iterations: Optional[StrictInt] = Field(default=None, description="The iteration count (factor) used to derive the hash. Optional for pbkdf2; when omitted, verification defaults to 24000 (the FusionAuth default factor).") - variant: Optional[StrictStr] = Field(default=None, description="The hashing variant. Required for pbkdf2 (e.g. salted-pbkdf2-hmac-sha256, salted-pbkdf2-hmac-sha256-512, salted-pbkdf2-hmac-sha512-512).") + iterations: Optional[StrictInt] = Field(default=None, description="The iteration count (factor) used to derive the hash. Optional for pbkdf2; when omitted, verification defaults to 24000 (the FusionAuth default factor). Rejected for firebase-scrypt.") + variant: Optional[StrictStr] = Field(default=None, description="The hashing variant. Required for pbkdf2 (e.g. salted-pbkdf2-hmac-sha256, salted-pbkdf2-hmac-sha256-512, salted-pbkdf2-hmac-sha512-512). Rejected for firebase-scrypt.") + signer_key: Optional[StrictStr] = Field(default=None, description="The base64-encoded signer key from the Firebase project's password hash parameters. Required for firebase-scrypt; rejected for other hashing methods.") + salt_separator: Optional[StrictStr] = Field(default=None, description="The base64-encoded salt separator from the Firebase project's password hash parameters. Required for firebase-scrypt; rejected for other hashing methods.") + rounds: Optional[StrictInt] = Field(default=None, description="The scrypt rounds from the Firebase project's password hash parameters (1-16). Required for firebase-scrypt; rejected for other hashing methods.") + mem_cost: Optional[StrictInt] = Field(default=None, description="The scrypt memory cost from the Firebase project's password hash parameters (1-20). Required for firebase-scrypt; rejected for other hashing methods.") is_temporary_password: Optional[StrictBool] = Field(default=None, description="The user will be prompted to set a new password after entering this one.") - __properties: ClassVar[List[str]] = ["hashed_password", "hashing_method", "salt", "salt_position", "iterations", "variant", "is_temporary_password"] + __properties: ClassVar[List[str]] = ["hashed_password", "hashing_method", "salt", "salt_position", "iterations", "variant", "signer_key", "salt_separator", "rounds", "mem_cost", "is_temporary_password"] @field_validator('hashing_method') def hashing_method_validate_enum(cls, value): @@ -42,8 +46,8 @@ def hashing_method_validate_enum(cls, value): if value is None: return value - if value not in set(['bcrypt', 'crypt', 'md5', 'sha256', 'wordpress', 'pbkdf2']): - raise ValueError("must be one of enum values ('bcrypt', 'crypt', 'md5', 'sha256', 'wordpress', 'pbkdf2')") + if value not in set(['bcrypt', 'crypt', 'md5', 'sha256', 'wordpress', 'pbkdf2', 'firebase-scrypt', 'aspnet-identity-v2']): + raise ValueError("must be one of enum values ('bcrypt', 'crypt', 'md5', 'sha256', 'wordpress', 'pbkdf2', 'firebase-scrypt', 'aspnet-identity-v2')") return value @field_validator('salt_position') @@ -113,6 +117,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "salt_position": obj.get("salt_position"), "iterations": obj.get("iterations"), "variant": obj.get("variant"), + "signer_key": obj.get("signer_key"), + "salt_separator": obj.get("salt_separator"), + "rounds": obj.get("rounds"), + "mem_cost": obj.get("mem_cost"), "is_temporary_password": obj.get("is_temporary_password") }) return _obj diff --git a/kinde_sdk/management/models/update_application_request.py b/kinde_sdk/management/models/update_application_request.py index 1233486b..b293981b 100644 --- a/kinde_sdk/management/models/update_application_request.py +++ b/kinde_sdk/management/models/update_application_request.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, 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 @@ -33,7 +33,15 @@ class UpdateApplicationRequest(BaseModel): redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="The application's redirect uris.") login_uri: Optional[StrictStr] = Field(default=None, description="The default login route for resolving session issues.") homepage_uri: Optional[StrictStr] = Field(default=None, description="The homepage link to your application.") - __properties: ClassVar[List[str]] = ["name", "language_key", "logout_uris", "redirect_uris", "login_uri", "homepage_uri"] + is_allow_faceless_auth: Optional[StrictBool] = Field(default=None, description="Bypass Kinde's sign up and sign in screens and use your own design.") + is_ask_for_name: Optional[StrictBool] = Field(default=None, description="Show fields to collect name details from users signing up with email or phone.") + has_marketing_consent: Optional[StrictBool] = Field(default=None, description="Show a marketing consent checkbox on the sign-up page.") + has_sign_in_link_on_sign_up_page: Optional[StrictBool] = Field(default=None, description="Allow users to switch to the login page from the sign-up page.") + has_register_link_on_sign_in_page: Optional[StrictBool] = Field(default=None, description="Allow users to switch to the register page from the sign-in page.") + has_sign_in_with_sso_button: Optional[StrictBool] = Field(default=None, description="When home realm discovery is configured, users see a button to prompt them to use their work email.") + use_gravatar_fallback: Optional[StrictBool] = Field(default=None, description="Use a backup image if a profile picture is not available.") + is_access_control_enabled: Optional[StrictBool] = Field(default=None, description="Whether role-based access control is enforced for the application. At least one allowed role must be configured before enabling.") + __properties: ClassVar[List[str]] = ["name", "language_key", "logout_uris", "redirect_uris", "login_uri", "homepage_uri", "is_allow_faceless_auth", "is_ask_for_name", "has_marketing_consent", "has_sign_in_link_on_sign_up_page", "has_register_link_on_sign_in_page", "has_sign_in_with_sso_button", "use_gravatar_fallback", "is_access_control_enabled"] model_config = ConfigDict( populate_by_name=True, @@ -91,7 +99,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "logout_uris": obj.get("logout_uris"), "redirect_uris": obj.get("redirect_uris"), "login_uri": obj.get("login_uri"), - "homepage_uri": obj.get("homepage_uri") + "homepage_uri": obj.get("homepage_uri"), + "is_allow_faceless_auth": obj.get("is_allow_faceless_auth"), + "is_ask_for_name": obj.get("is_ask_for_name"), + "has_marketing_consent": obj.get("has_marketing_consent"), + "has_sign_in_link_on_sign_up_page": obj.get("has_sign_in_link_on_sign_up_page"), + "has_register_link_on_sign_in_page": obj.get("has_register_link_on_sign_in_page"), + "has_sign_in_with_sso_button": obj.get("has_sign_in_with_sso_button"), + "use_gravatar_fallback": obj.get("use_gravatar_fallback"), + "is_access_control_enabled": obj.get("is_access_control_enabled") }) return _obj diff --git a/kinde_sdk/management/models/update_connection_request_options_one_of1.py b/kinde_sdk/management/models/update_connection_request_options_one_of1.py index ff709ec5..077ce82f 100644 --- a/kinde_sdk/management/models/update_connection_request_options_one_of1.py +++ b/kinde_sdk/management/models/update_connection_request_options_one_of1.py @@ -29,7 +29,8 @@ class UpdateConnectionRequestOptionsOneOf1(BaseModel): """ # noqa: E501 home_realm_domains: Optional[List[StrictStr]] = Field(default=None, description="List of domains to restrict authentication.") saml_entity_id: Optional[StrictStr] = Field(default=None, description="SAML Entity ID.") - saml_idp_metadata_url: Optional[StrictStr] = Field(default=None, description="URL for the IdP metadata.") + saml_idp_metadata_url: Optional[StrictStr] = Field(default=None, description="URL for the IdP metadata. Optional if saml_idp_metadata_xml is provided.") + saml_idp_metadata_xml: Optional[StrictStr] = Field(default=None, description="Raw IdP metadata XML. Use when the IdP does not host a metadata URL (e.g. Google Workspace). Takes precedence over saml_idp_metadata_url when both are set.") saml_sign_in_url: Optional[StrictStr] = Field(default=None, description="Override the default SSO endpoint with a URL your IdP recognizes.") sign_request_algorithm: Optional[StrictStr] = Field(default=None, description="Algorithm used to sign SAML requests.") protocol_binding: Optional[StrictStr] = Field(default=None, description="Protocol binding used to send SAML requests.") @@ -45,7 +46,7 @@ class UpdateConnectionRequestOptionsOneOf1(BaseModel): saml_signing_private_key: Optional[StrictStr] = Field(default=None, description="Private key associated with the signing certificate.") is_use_custom_domain: Optional[StrictBool] = Field(default=None, description="Use custom domain callback URL.") is_trusted: Optional[StrictBool] = Field(default=None, description="Trust this connection for account merging.") - __properties: ClassVar[List[str]] = ["home_realm_domains", "saml_entity_id", "saml_idp_metadata_url", "saml_sign_in_url", "sign_request_algorithm", "protocol_binding", "name_id_format", "saml_email_key_attr", "saml_user_id_key_attr", "saml_first_name_key_attr", "saml_last_name_key_attr", "is_create_missing_user", "is_force_show_sso_button", "upstream_params", "saml_signing_certificate", "saml_signing_private_key", "is_use_custom_domain", "is_trusted"] + __properties: ClassVar[List[str]] = ["home_realm_domains", "saml_entity_id", "saml_idp_metadata_url", "saml_idp_metadata_xml", "saml_sign_in_url", "sign_request_algorithm", "protocol_binding", "name_id_format", "saml_email_key_attr", "saml_user_id_key_attr", "saml_first_name_key_attr", "saml_last_name_key_attr", "is_create_missing_user", "is_force_show_sso_button", "upstream_params", "saml_signing_certificate", "saml_signing_private_key", "is_use_custom_domain", "is_trusted"] @field_validator('sign_request_algorithm') def sign_request_algorithm_validate_enum(cls, value): @@ -131,6 +132,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "home_realm_domains": obj.get("home_realm_domains"), "saml_entity_id": obj.get("saml_entity_id"), "saml_idp_metadata_url": obj.get("saml_idp_metadata_url"), + "saml_idp_metadata_xml": obj.get("saml_idp_metadata_xml"), "saml_sign_in_url": obj.get("saml_sign_in_url"), "sign_request_algorithm": obj.get("sign_request_algorithm"), "protocol_binding": obj.get("protocol_binding"), diff --git a/kinde_sdk/management/models/update_organization_request.py b/kinde_sdk/management/models/update_organization_request.py index 31376477..b047342b 100644 --- a/kinde_sdk/management/models/update_organization_request.py +++ b/kinde_sdk/management/models/update_organization_request.py @@ -27,7 +27,7 @@ class UpdateOrganizationRequest(BaseModel): """ UpdateOrganizationRequest """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="The organization's name.") + name: Optional[StrictStr] = Field(default=None, description="The organization's name. If the organization is a billing customer, this update is also propagated to the corresponding billing customer details. ") external_id: Optional[StrictStr] = Field(default=None, description="The organization's ID.") background_color: Optional[StrictStr] = Field(default=None, description="The organization's brand settings - background color.") button_color: Optional[StrictStr] = Field(default=None, description="The organization's brand settings - button color.") diff --git a/kinde_sdk/management/models/update_user_request.py b/kinde_sdk/management/models/update_user_request.py index 8080695a..6604c9ae 100644 --- a/kinde_sdk/management/models/update_user_request.py +++ b/kinde_sdk/management/models/update_user_request.py @@ -27,8 +27,8 @@ class UpdateUserRequest(BaseModel): """ UpdateUserRequest """ # noqa: E501 - given_name: Optional[StrictStr] = Field(default=None, description="User's first name.") - family_name: Optional[StrictStr] = Field(default=None, description="User's last name.") + given_name: Optional[StrictStr] = Field(default=None, description="User's first name. If the user is the owner of a family billing customer, this update is also propagated to the corresponding billing customer details. ") + family_name: Optional[StrictStr] = Field(default=None, description="User's last name. If the user is the owner of a family billing customer, this update is also propagated to the corresponding billing customer details. ") picture: Optional[StrictStr] = Field(default=None, description="The user's profile picture.") is_suspended: Optional[StrictBool] = Field(default=None, description="Whether the user is currently suspended or not.") is_password_reset_requested: Optional[StrictBool] = Field(default=None, description="Prompt the user to change their password on next sign in.")