Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate SDK using a generator #2

Merged
merged 40 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b2c383d
Generate SDK using a generator (Issue #1) implementation started
Aditya-Kumar-Code Apr 21, 2024
40bbcdb
abdm-hiu-sdk created using open-api generator
Aditya-Kumar-Code Apr 22, 2024
9ad8170
new apis created
Aditya-Kumar-Code Apr 23, 2024
a5e42b4
file check
Aditya-Kumar-Code Apr 23, 2024
6321ed7
some changes done
Aditya-Kumar-Code Apr 23, 2024
45e68cb
uneccesary file removal
Aditya-Kumar-Code Apr 23, 2024
34d403c
file remove
Aditya-Kumar-Code Apr 23, 2024
63500a8
remove
Aditya-Kumar-Code Apr 23, 2024
1305eea
push change
Aditya-Kumar-Code Apr 23, 2024
4128af3
file delete
Aditya-Kumar-Code Apr 23, 2024
cd19c14
Delete .DS_Store
Aditya-Kumar-Code Apr 23, 2024
01ddd28
getting data example
Aditya-Kumar-Code Apr 23, 2024
0f50f92
edit
Aditya-Kumar-Code Apr 23, 2024
602eae2
readme changed
Aditya-Kumar-Code Apr 23, 2024
2c90c88
change
Aditya-Kumar-Code Apr 23, 2024
b74195e
txt removed
Aditya-Kumar-Code Apr 23, 2024
93646d4
small changes
Aditya-Kumar-Code Apr 23, 2024
d4a407c
examples added
Aditya-Kumar-Code Apr 23, 2024
05745bf
sdk created
Aditya-Kumar-Code Apr 24, 2024
dc5e55d
yaml modified
Aditya-Kumar-Code Apr 24, 2024
12e4723
ruff format
Aditya-Kumar-Code Apr 25, 2024
c820815
ruff --fix
Aditya-Kumar-Code Apr 25, 2024
373deca
ruff
Aditya-Kumar-Code Apr 25, 2024
c62dddf
unit testing done
Aditya-Kumar-Code Apr 25, 2024
0bcdd86
workflow
Aditya-Kumar-Code Apr 25, 2024
ea664af
ruff
Aditya-Kumar-Code Apr 25, 2024
967dda1
linting
Aditya-Kumar-Code Apr 25, 2024
1b981da
linting done
Aditya-Kumar-Code Apr 25, 2024
5896303
format
Aditya-Kumar-Code Apr 25, 2024
5047028
gitignore
Aditya-Kumar-Code Apr 25, 2024
ddf1734
test type check skipped
Aditya-Kumar-Code Apr 25, 2024
f12ccd6
Delete .DS_Store
Aditya-Kumar-Code Apr 25, 2024
ea16e86
Pycache deleted
Aditya-Kumar-Code Apr 25, 2024
f1c6f96
format
Aditya-Kumar-Code Apr 25, 2024
dc0b52b
push
Aditya-Kumar-Code Apr 25, 2024
9b78f1a
Delete .DS_Store
Aditya-Kumar-Code Apr 25, 2024
50c2690
chore: remove pycache artifacts
sutyum Apr 25, 2024
6cc663d
examples added
Aditya-Kumar-Code Apr 25, 2024
a2667aa
Update abdm.yml
Aditya-Kumar-Code Apr 25, 2024
9fbc7a9
ruff
Aditya-Kumar-Code Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
78 changes: 78 additions & 0 deletions .github/workflows/abdm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# URL: https://openapi-generator.tech
#
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: abdm Python package
sutyum marked this conversation as resolved.
Show resolved Hide resolved

on: [push, pull_request]
sutyum marked this conversation as resolved.
Show resolved Hide resolved

jobs:

check:
runs-on: ubuntu-latest # host's operating system
steps: # each job consists of 1+ steps
- name: Checkout commit # download the code from triggering commit
uses: actions/checkout@v4

- name: Set up Python and Poetry
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: |
cd .
poetry install --no-interaction --no-root

- name: Format with Ruff
run: |
cd .
poetry run ruff format --check .

- name: Lint with Ruff
run: |
cd .
poetry run ruff check -- .

- name: Type check
run: |
cd .
poetry run python -m mypy .
test:
runs-on: ubuntu-latest
needs: check
steps: # each job consists of 1+ steps
- name: Checkout commit # download the code from triggering commit
uses: actions/checkout@v4

- name: Set up Python and Poetry
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: |
cd .
poetry install --no-interaction --no-root

- name: Test with pytest
run: |
cd .
poetry run pytest -vvv


5 changes: 5 additions & 0 deletions .gitignore
sutyum marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,8 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

#unnecessary files
.tox.ini
.DS_Store
git_push.sh
21 changes: 0 additions & 21 deletions LICENSE
sutyum marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

263 changes: 261 additions & 2 deletions README.md

Large diffs are not rendered by default.

157 changes: 157 additions & 0 deletions abdm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# coding: utf-8

# flake8: noqa

"""
Health Repository Provider Specifications for HIU

The following are the specifications for the APIs to be implemented at the Health Repository end if an entity is only serving the role of a HIU. The specs are essentially duplicates from the Gateway and Bridge, but put together so as to make it clear to *HIUs* which set of APIs they should implement to participate in the network. 1. The APIs are organized by the flows - **identification**, **consent flow**, **data flow** and **monitoring**. They represent the APIs that are expected to be available at the HIU end by the Gateway. 2. For majority of the APIs, if Gateway has initiated a call, there are corresponding callback APIs on the Gateway. e.g for **/consents/hiu/notify** API on HIU end, its expected that a corresponding callback API **/consents/hiu/on-notify** on Gateway is called. Such APIs are organized under the **Gateway** label. 3. Gateway relevant APIs for HIUs are grouped under **Gateway** label. These include the APIs that HIPs are required to call on the Gateway. For example, to request a CM for consent, HIU would call **/consent-requests/init** API on gateway. 4. **NOTE**, in some of the API documentations below, **X-HIP-ID** is mentioned in header (for example in /auth/on-init). These are the cases, when a particular API is applicable for both HIU and HIP (e.g an entity is playing the role of HRP representing both HIU and HIP). If you are only playing the role of HIP, then only X-HIU-ID header will be sent

The version of the OpenAPI document: 0.5
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


__version__ = "1.0.0"

# import apis into sdk package
from abdm.api.gateway_api import GatewayAPI
from abdm.api.consent_flow_api import ConsentFlowAPI
from abdm.api.data_flow_api import DataFlowAPI
from abdm.api.identification_api import IdentificationAPI
from abdm.api.monitoring_api import MonitoringAPI
from abdm.api.patient_notification_api import PatientNotificationAPI
from abdm.api.subscriptions_api import SubscriptionsAPI
from abdm.api.user_auth_api import UserAuthAPI

# import ApiClient
from abdm.api_response import ApiResponse
from abdm.api_client import ApiClient
from abdm.configuration import Configuration
from abdm.exceptions import OpenApiException
from abdm.exceptions import ApiTypeError
from abdm.exceptions import ApiValueError
from abdm.exceptions import ApiKeyError
from abdm.exceptions import ApiAttributeError
from abdm.exceptions import ApiException

# import models into sdk package
from abdm.abdm.model.access_token_validity_model import AccessTokenValidityModel
from abdm.abdm.model.auth_confirm_identifier_model import AuthConfirmIdentifierModel
from abdm.abdm.model.auth_confirm_identifier_type_model import AuthConfirmIdentifierTypeModel
from abdm.abdm.model.auth_meta_model import AuthMetaModel
from abdm.abdm.model.authentication_mode_model import AuthenticationModeModel
from abdm.abdm.model.care_context_definition_model import CareContextDefinitionModel
from abdm.abdm.model.certificate_or_key_get_schema_model import CertificateOrKeyGetSchemaModel
from abdm.abdm.model.certs_model import CertsModel
from abdm.abdm.model.consent_acknowledgement_model import ConsentAcknowledgementModel
from abdm.abdm.model.consent_artefact_reference_model import ConsentArtefactReferenceModel
from abdm.abdm.model.consent_artefact_response_consent_consent_detail_care_contexts_inner_model import ConsentArtefactResponseConsentConsentDetailCareContextsInnerModel
from abdm.abdm.model.consent_artefact_response_consent_consent_detail_consent_manager_model import ConsentArtefactResponseConsentConsentDetailConsentManagerModel
from abdm.abdm.model.consent_artefact_response_consent_consent_detail_hip_model import ConsentArtefactResponseConsentConsentDetailHipModel
from abdm.abdm.model.consent_artefact_response_consent_consent_detail_hiu_model import ConsentArtefactResponseConsentConsentDetailHiuModel
from abdm.abdm.model.consent_artefact_response_consent_consent_detail_model import ConsentArtefactResponseConsentConsentDetailModel
from abdm.abdm.model.consent_artefact_response_consent_model import ConsentArtefactResponseConsentModel
from abdm.abdm.model.consent_artefact_response_model import ConsentArtefactResponseModel
from abdm.abdm.model.consent_fetch_request_model import ConsentFetchRequestModel
from abdm.abdm.model.consent_manager_patient_id_model import ConsentManagerPatientIDModel
from abdm.abdm.model.consent_model import ConsentModel
from abdm.abdm.model.consent_request_consent_model import ConsentRequestConsentModel
from abdm.abdm.model.consent_request_consent_patient_model import ConsentRequestConsentPatientModel
from abdm.abdm.model.consent_request_init_response_consent_request_model import ConsentRequestInitResponseConsentRequestModel
from abdm.abdm.model.consent_request_init_response_model import ConsentRequestInitResponseModel
from abdm.abdm.model.consent_request_model import ConsentRequestModel
from abdm.abdm.model.consent_request_status_request_model import ConsentRequestStatusRequestModel
from abdm.abdm.model.consent_status_model import ConsentStatusModel
from abdm.abdm.model.data_notification_entries_inner_model import DataNotificationEntriesInnerModel
from abdm.abdm.model.data_notification_model import DataNotificationModel
from abdm.abdm.model.date_range_model import DateRangeModel
from abdm.abdm.model.entry_content_model import EntryContentModel
from abdm.abdm.model.entry_link_model import EntryLinkModel
from abdm.abdm.model.error_model import ErrorModel
from abdm.abdm.model.error_response_model import ErrorResponseModel
from abdm.abdm.model.event_category_detail_model import EventCategoryDetailModel
from abdm.abdm.model.hi_request_hi_request_model import HIRequestHiRequestModel
from abdm.abdm.model.hi_request_model import HIRequestModel
from abdm.abdm.model.hi_type_enum_model import HITypeEnumModel
from abdm.abdm.model.hiu_consent_notification_event_model import HIUConsentNotificationEventModel
from abdm.abdm.model.hiu_consent_notification_event_notification_model import HIUConsentNotificationEventNotificationModel
from abdm.abdm.model.hiu_consent_notification_response_model import HIUConsentNotificationResponseModel
from abdm.abdm.model.hiu_consent_request_status_consent_request_model import HIUConsentRequestStatusConsentRequestModel
from abdm.abdm.model.hiu_consent_request_status_model import HIUConsentRequestStatusModel
from abdm.abdm.model.hiu_health_information_request_response_hi_request_model import HIUHealthInformationRequestResponseHiRequestModel
from abdm.abdm.model.hiu_health_information_request_response_model import HIUHealthInformationRequestResponseModel
from abdm.abdm.model.hiu_subscription_context_model import HIUSubscriptionContextModel
from abdm.abdm.model.hiu_subscription_event_content_model import HIUSubscriptionEventContentModel
from abdm.abdm.model.hiu_subscription_model import HIUSubscriptionModel
from abdm.abdm.model.hiu_subscription_notification_acknowledgment_acknowledgement_model import HIUSubscriptionNotificationAcknowledgmentAcknowledgementModel
from abdm.abdm.model.hiu_subscription_notification_acknowledgment_model import HIUSubscriptionNotificationAcknowledgmentModel
from abdm.abdm.model.hiu_subscription_notification_event_model import HIUSubscriptionNotificationEventModel
from abdm.abdm.model.hiu_subscription_notification_model import HIUSubscriptionNotificationModel
from abdm.abdm.model.hiu_subscription_request_notification_acknowledgement_acknowledgement_model import HIUSubscriptionRequestNotificationAcknowledgementAcknowledgementModel
from abdm.abdm.model.hiu_subscription_request_notification_acknowledgement_model import HIUSubscriptionRequestNotificationAcknowledgementModel
from abdm.abdm.model.hiu_subscription_request_receipt_model import HIUSubscriptionRequestReceiptModel
from abdm.abdm.model.health_information_notification_model import HealthInformationNotificationModel
from abdm.abdm.model.health_information_notification_notification_model import HealthInformationNotificationNotificationModel
from abdm.abdm.model.health_information_notification_notification_notifier_model import HealthInformationNotificationNotificationNotifierModel
from abdm.abdm.model.health_information_notification_notification_status_notification_model import HealthInformationNotificationNotificationStatusNotificationModel
from abdm.abdm.model.health_information_notification_notification_status_notification_status_responses_inner_model import HealthInformationNotificationNotificationStatusNotificationStatusResponsesInnerModel
from abdm.abdm.model.heartbeat_response_model import HeartbeatResponseModel
from abdm.abdm.model.hiu_patient_status_notification_model import HiuPatientStatusNotificationModel
from abdm.abdm.model.hiu_patient_status_notification_notification_model import HiuPatientStatusNotificationNotificationModel
from abdm.abdm.model.hiu_patient_status_notification_notification_patient_model import HiuPatientStatusNotificationNotificationPatientModel
from abdm.abdm.model.identifier_model import IdentifierModel
from abdm.abdm.model.identifier_type_model import IdentifierTypeModel
from abdm.abdm.model.key_material_model import KeyMaterialModel
from abdm.abdm.model.key_object_model import KeyObjectModel
from abdm.abdm.model.open_id_configuration_model import OpenIdConfigurationModel
from abdm.abdm.model.organization_representation_model import OrganizationRepresentationModel
from abdm.abdm.model.patient_address_model import PatientAddressModel
from abdm.abdm.model.patient_auth_confirm_request_credential_model import PatientAuthConfirmRequestCredentialModel
from abdm.abdm.model.patient_auth_confirm_request_model import PatientAuthConfirmRequestModel
from abdm.abdm.model.patient_auth_confirm_response_auth_model import PatientAuthConfirmResponseAuthModel
from abdm.abdm.model.patient_auth_confirm_response_model import PatientAuthConfirmResponseModel
from abdm.abdm.model.patient_auth_init_request_model import PatientAuthInitRequestModel
from abdm.abdm.model.patient_auth_init_request_query_model import PatientAuthInitRequestQueryModel
from abdm.abdm.model.patient_auth_init_request_query_requester_model import PatientAuthInitRequestQueryRequesterModel
from abdm.abdm.model.patient_auth_init_response_auth_model import PatientAuthInitResponseAuthModel
from abdm.abdm.model.patient_auth_init_response_model import PatientAuthInitResponseModel
from abdm.abdm.model.patient_auth_mode_query_request_model import PatientAuthModeQueryRequestModel
from abdm.abdm.model.patient_auth_mode_query_request_query_model import PatientAuthModeQueryRequestQueryModel
from abdm.abdm.model.patient_auth_mode_query_request_query_requester_model import PatientAuthModeQueryRequestQueryRequesterModel
from abdm.abdm.model.patient_auth_mode_query_response_auth_model import PatientAuthModeQueryResponseAuthModel
from abdm.abdm.model.patient_auth_mode_query_response_model import PatientAuthModeQueryResponseModel
from abdm.abdm.model.patient_auth_notification_acknowledgement_acknowledgement_model import PatientAuthNotificationAcknowledgementAcknowledgementModel
from abdm.abdm.model.patient_auth_notification_acknowledgement_model import PatientAuthNotificationAcknowledgementModel
from abdm.abdm.model.patient_auth_notification_auth_model import PatientAuthNotificationAuthModel
from abdm.abdm.model.patient_auth_notification_model import PatientAuthNotificationModel
from abdm.abdm.model.patient_auth_purpose_model import PatientAuthPurposeModel
from abdm.abdm.model.patient_auth_requester_model import PatientAuthRequesterModel
from abdm.abdm.model.patient_demographic_model import PatientDemographicModel
from abdm.abdm.model.patient_demographic_response_model import PatientDemographicResponseModel
from abdm.abdm.model.patient_gender_model import PatientGenderModel
from abdm.abdm.model.patient_identification_request_model import PatientIdentificationRequestModel
from abdm.abdm.model.patient_identification_request_query_model import PatientIdentificationRequestQueryModel
from abdm.abdm.model.patient_identification_request_query_patient_model import PatientIdentificationRequestQueryPatientModel
from abdm.abdm.model.patient_identification_request_query_requester_model import PatientIdentificationRequestQueryRequesterModel
from abdm.abdm.model.patient_identification_response_model import PatientIdentificationResponseModel
from abdm.abdm.model.patient_identification_response_patient_model import PatientIdentificationResponsePatientModel
from abdm.abdm.model.patient_status_notification_model import PatientStatusNotificationModel
from abdm.abdm.model.permission_date_range_model import PermissionDateRangeModel
from abdm.abdm.model.permission_frequency_model import PermissionFrequencyModel
from abdm.abdm.model.permission_model import PermissionModel
from abdm.abdm.model.request_reference_model import RequestReferenceModel
from abdm.abdm.model.requester_identifier_model import RequesterIdentifierModel
from abdm.abdm.model.requester_model import RequesterModel
from abdm.abdm.model.session_request_model import SessionRequestModel
from abdm.abdm.model.session_response_model import SessionResponseModel
from abdm.abdm.model.subscription_approval_notification_model import SubscriptionApprovalNotificationModel
from abdm.abdm.model.subscription_approval_notification_notification_model import SubscriptionApprovalNotificationNotificationModel
from abdm.abdm.model.subscription_category_model import SubscriptionCategoryModel
from abdm.abdm.model.subscription_period_model import SubscriptionPeriodModel
from abdm.abdm.model.subscription_request_model import SubscriptionRequestModel
from abdm.abdm.model.subscription_request_subscription_model import SubscriptionRequestSubscriptionModel
from abdm.abdm.model.subscription_status_model import SubscriptionStatusModel
from abdm.abdm.model.use_purpose_model import UsePurposeModel
12 changes: 12 additions & 0 deletions abdm/abdm/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# flake8: noqa

# import apis into api package
from abdm.api.gateway_api import GatewayAPI
from abdm.api.consent_flow_api import ConsentFlowAPI
from abdm.api.data_flow_api import DataFlowAPI
from abdm.api.identification_api import IdentificationAPI
from abdm.api.monitoring_api import MonitoringAPI
from abdm.api.patient_notification_api import PatientNotificationAPI
from abdm.api.subscriptions_api import SubscriptionsAPI
from abdm.api.user_auth_api import UserAuthAPI

Loading
Loading