1
0
mirror of synced 2025-12-19 18:14:56 -05:00

[Non-forked] Source Younium: Adding Booking and Account streams (#31064)

Co-authored-by: Hans Peter Hagblom <hans.peter.hagblom@eletive.com>
This commit is contained in:
Sajarin
2023-10-04 17:51:09 -04:00
committed by GitHub
parent db0dcc74ed
commit 0fe0b911a1
14 changed files with 975 additions and 406 deletions

View File

@@ -34,5 +34,5 @@ COPY source_younium ./source_younium
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
LABEL io.airbyte.version=0.1.0
LABEL io.airbyte.name=airbyte/source-younium
LABEL io.airbyte.version=0.2.0
LABEL io.airbyte.name=airbyte/source-younium

View File

@@ -1,26 +1,28 @@
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-younium:dev
tests:
acceptance_tests:
spec:
- spec_path: "source_younium/spec.yaml"
tests:
- spec_path: "source_younium/spec.yaml"
connection:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
tests:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
tests:
- config_path: "secrets/config.json"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
# expect_records:
# path: "integration_tests/expected_records.jsonl"
# extra_fields: no
# exact_order: no
# extra_records: yes
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
expect_records:
path: "integration_tests/expected_records.jsonl"
fail_on_extra_columns: false
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"

View File

@@ -1,5 +1,23 @@
{
"streams": [
{
"stream": {
"name": "account",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "booking",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "invoice",

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 9c74c2d7-531a-4ebf-b6d8-6181f805ecdc
dockerImageTag: 0.1.0
dockerImageTag: 0.2.0
dockerRepository: airbyte/source-younium
githubIssueLabel: source-younium
icon: younium.svg

View File

@@ -0,0 +1,212 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"properties": {
"accountNumber": {
"type": ["null", "string"]
},
"accountType": {
"type": ["null", "string"]
},
"accountsReceivable": {
"type": ["null", "string"]
},
"acv": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
}
},
"type": "object"
},
"addresses": {
"items": {
"additionalProperties": true,
"properties": {
"city": {
"type": ["null", "string"]
},
"country": {
"type": ["null", "string"]
},
"description": {
"type": ["null", "string"]
},
"id": {
"type": ["null", "string"]
},
"street": {
"type": ["null", "string"]
},
"zip": {
"type": ["null", "string"]
}
},
"type": "object"
},
"type": "array"
},
"cmrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
}
},
"type": "object"
},
"created": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"customFields": {
"additionalProperties": true,
"type": "object"
},
"defaultDeliveryAddress": {
"additionalProperties": true,
"properties": {
"country": {
"type": ["null", "string"]
},
"id": {
"type": ["null", "string"]
}
},
"type": "object"
},
"defaultInvoiceAddress": {
"additionalProperties": true,
"properties": {
"city": {
"type": ["null", "string"]
},
"country": {
"type": ["null", "string"]
},
"description": {
"type": ["null", "string"]
},
"id": {
"type": ["null", "string"]
},
"street": {
"type": ["null", "string"]
},
"zip": {
"type": ["null", "string"]
}
},
"type": "object"
},
"defaultPaymentTerm": {
"type": ["null", "string"]
},
"emrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
}
},
"type": "object"
},
"id": {
"type": ["null", "string"]
},
"inactive": {
"type": ["null", "boolean"]
},
"invoiceDeliveryMethod": {
"type": ["null", "string"]
},
"invoiceTemplateId": {
"type": ["null", "string"]
},
"modified": {
"type": ["null", "string"]
},
"name": {
"type": ["null", "string"]
},
"oneTimeFees": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
}
},
"type": "object"
},
"organizationNumber": {
"type": ["null", "string"]
},
"ourReference": {
"type": ["null", "string"]
},
"taxRegistrationNumber": {
"type": ["null", "string"]
},
"taxTemplate": {
"type": ["null", "string"]
},
"tcv": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
}
},
"type": "object"
}
},
"type": "object"
}

View File

@@ -0,0 +1,292 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"properties": {
"accountCategory": {
"type": ["null", "string"]
},
"acv": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"amountInBaseCurrency": {
"type": ["null", "number"]
}
},
"type": "object"
},
"bookingLines": {
"items": {
"additionalProperties": true,
"properties": {
"acv": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"currencyConversionDate": {
"type": ["null", "string"]
}
},
"type": "object"
},
"charge": {
"additionalProperties": true,
"properties": {
"chargeNumber": {
"type": ["null", "string"]
},
"description": {
"type": ["null", "string"]
},
"id": {
"type": ["null", "string"]
},
"name": {
"type": ["null", "string"]
}
},
"type": "object"
},
"cmrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"currencyConversionDate": {
"type": ["null", "string"]
}
},
"type": "object"
},
"created": {
"type": ["null", "string"]
},
"emrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"currencyConversionDate": {
"type": ["null", "string"]
}
},
"type": "object"
},
"fmrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"currencyConversionDate": {
"type": ["null", "string"]
}
},
"type": "object"
},
"modified": {
"type": ["null", "string"]
},
"oneTimeFees": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"currencyConversionDate": {
"type": ["null", "string"]
}
},
"type": "object"
},
"tcv": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"baseCurrencyAmount": {
"type": ["null", "number"]
},
"baseCurrencyCode": {
"type": ["null", "string"]
},
"currencyCode": {
"type": ["null", "string"]
},
"currencyConversionDate": {
"type": ["null", "string"]
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"bookingType": {
"type": ["null", "string"]
},
"changeType": {
"type": ["null", "string"]
},
"classification": {
"additionalProperties": true,
"properties": {
"chartColor": {
"type": ["null", "string"]
},
"classificationType": {
"type": ["null", "string"]
},
"description": {
"type": ["null", "string"]
},
"isSystemClassification": {
"type": ["null", "boolean"]
},
"name": {
"type": ["null", "string"]
}
},
"type": "object"
},
"cmrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"amountInBaseCurrency": {
"type": ["null", "number"]
}
},
"type": "object"
},
"created": {
"type": ["null", "string"]
},
"effectiveDate": {
"type": ["null", "string"]
},
"emrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"amountInBaseCurrency": {
"type": ["null", "number"]
}
},
"type": "object"
},
"fmrr": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"amountInBaseCurrency": {
"type": ["null", "number"]
}
},
"type": "object"
},
"id": {
"type": ["null", "string"]
},
"modified": {
"type": ["null", "string"]
},
"oneTimeFees": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"amountInBaseCurrency": {
"type": ["null", "number"]
}
},
"type": "object"
},
"order": {
"additionalProperties": true,
"properties": {
"id": {
"type": ["null", "string"]
},
"orderNumber": {
"type": ["null", "string"]
}
},
"type": "object"
},
"tcv": {
"additionalProperties": true,
"properties": {
"amount": {
"type": ["null", "number"]
},
"amountInBaseCurrency": {
"type": ["null", "number"]
}
},
"type": "object"
}
},
"type": "object"
}

View File

@@ -1,121 +1,122 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"invoiceNumber": {
"type": "string"
"type": ["null", "string"]
},
"status": {
"type": "string"
"type": ["null", "string"]
},
"account": {
"type": "object",
"properties": {
"name": {
"type": "string"
"type": ["null", "string"]
},
"accountNumber": {
"type": "string"
"type": ["null", "string"]
},
"id": {
"type": "string"
"type": ["null", "string"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
}
}
},
"notes": {
"type": "string"
"type": ["null", "string"]
},
"invoiceDate": {
"type": "string"
"type": ["null", "string"]
},
"dueDate": {
"type": "string"
"type": ["null", "string"]
},
"daysPastDue": {
"type": "number"
"type": ["null", "number"]
},
"nrOfReminders": {
"type": "number"
"type": ["null", "number"]
},
"paymentTerm": {
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"days": {
"type": "number"
"type": ["null", "number"]
},
"name": {
"type": "string"
"type": ["null", "string"]
}
}
},
"currency": {
"type": "string"
"type": ["null", "string"]
},
"subtotal": {
"type": "number"
"type": ["null", "number"]
},
"tax": {
"type": "number"
"type": ["null", "number"]
},
"totalAmount": {
"type": "number"
"type": ["null", "number"]
},
"totalRoundingAmount": {
"type": "number"
"type": ["null", "number"]
},
"settledAmount": {
"type": "number"
"type": ["null", "number"]
},
"balancedAmount": {
"type": "number"
"type": ["null", "number"]
},
"taxIncluded": {
"type": "boolean"
"type": ["null", "boolean"]
},
"invoiceAddress": {
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"street": {
"type": "string"
"type": ["null", "string"]
},
"street2": {
"type": "string"
"type": ["null", "string"]
},
"city": {
"type": "string"
"type": ["null", "string"]
},
"county": {
"type": "string"
"type": ["null", "string"]
},
"state": {
"type": "string"
"type": ["null", "string"]
},
"zip": {
"type": "string"
"type": ["null", "string"]
},
"country": {
"type": "string"
"type": ["null", "string"]
}
}
},
@@ -123,39 +124,39 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"street": {
"type": "string"
"type": ["null", "string"]
},
"street2": {
"type": "string"
"type": ["null", "string"]
},
"city": {
"type": "string"
"type": ["null", "string"]
},
"county": {
"type": "string"
"type": ["null", "string"]
},
"state": {
"type": "string"
"type": ["null", "string"]
},
"zip": {
"type": "string"
"type": ["null", "string"]
},
"country": {
"type": "string"
"type": ["null", "string"]
}
}
},
"invoiceBatchId": {
"type": "string"
"type": ["null", "string"]
},
"invoiceLines": {
"type": "array",
@@ -163,96 +164,96 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"invoiceLineNumber": {
"type": "number"
"type": ["null", "number"]
},
"productNumber": {
"type": "string"
"type": ["null", "string"]
},
"productName": {
"type": "string"
"type": ["null", "string"]
},
"chargeDescription": {
"type": "string"
"type": ["null", "string"]
},
"chargeNumber": {
"type": "string"
"type": ["null", "string"]
},
"quantity": {
"type": "number"
"type": ["null", "number"]
},
"unitOfMeasure": {
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"unitCode": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"displayName": {
"type": "string"
"type": ["null", "string"]
}
}
},
"price": {
"type": "number"
"type": ["null", "number"]
},
"subtotal": {
"type": "number"
"type": ["null", "number"]
},
"total": {
"type": "number"
"type": ["null", "number"]
},
"tax": {
"type": "number"
"type": ["null", "number"]
},
"servicePeriodStartDate": {
"type": "string"
"type": ["null", "string"]
},
"servicePeriodEndDate": {
"type": "string"
"type": ["null", "string"]
},
"notes": {
"type": "string"
"type": ["null", "string"]
},
"orderChargeId": {
"type": "string"
"type": ["null", "string"]
},
"orderId": {
"type": "string"
"type": ["null", "string"]
},
"accountId": {
"type": "string"
"type": ["null", "string"]
},
"customFields": {
"type": "object"
"type": ["null", "object"]
},
"accountsReceivable": {
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"code": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
}
}
},
@@ -260,22 +261,22 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"code": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
}
}
},
@@ -283,104 +284,104 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"code": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
}
}
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
},
"taxCategoryName": {
"type": "string"
"type": ["null", "string"]
},
"taxRate": {
"type": "number"
"type": ["null", "number"]
}
}
}
},
"yourReference": {
"type": "string"
"type": ["null", "string"]
},
"ourReference": {
"type": "string"
"type": ["null", "string"]
},
"yourOrderNumber": {
"type": "string"
"type": ["null", "string"]
},
"buyerReference": {
"type": "string"
"type": ["null", "string"]
},
"invoiceType": {
"type": "string"
"type": ["null", "string"]
},
"sendMethod": {
"type": "string"
"type": ["null", "string"]
},
"exchangeRate": {
"type": "number"
"type": ["null", "number"]
},
"settledNotes": {
"type": "string"
"type": ["null", "string"]
},
"invoiceTemplateId": {
"type": "string"
"type": ["null", "string"]
},
"disableAutomaticInvoiceReminder": {
"type": "boolean"
"type": ["null", "boolean"]
},
"onlinePaymentLink": {
"type": "string"
"type": ["null", "string"]
},
"accountsReceivable": {
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"code": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
}
}
},
"customFields": {
"type": "object"
"type": ["null", "object"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
}
}
}

View File

@@ -1,36 +1,37 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"productNumber": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"productType": {
"type": "string"
"type": ["null", "string"]
},
"category": {
"type": "string"
"type": ["null", "string"]
},
"activationDate": {
"type": "string"
"type": ["null", "string"]
},
"endOfNewSalesDate": {
"type": "string"
"type": ["null", "string"]
},
"endOfRenewalDate": {
"type": "string"
"type": ["null", "string"]
},
"endOfLifeDate": {
"type": "string"
"type": ["null", "string"]
},
"isFrameworkProduct": {
"type": "boolean"
"type": ["null", "boolean"]
},
"chargePlans": {
"type": "array",
@@ -38,22 +39,22 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"chargePlanNumber": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"effectiveStartDate": {
"type": "string"
"type": ["null", "string"]
},
"endOfNewSalesDate": {
"type": "string"
"type": ["null", "string"]
},
"effectiveEndDate": {
"type": "string"
"type": ["null", "string"]
},
"charges": {
"type": "array",
@@ -61,70 +62,70 @@
"type": "object",
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"chargeNumber": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": "string"
"type": ["null", "string"]
},
"model": {
"type": "string"
"type": ["null", "string"]
},
"chargeType": {
"type": "string"
"type": ["null", "string"]
},
"unitCode": {
"type": "string"
"type": ["null", "string"]
},
"defaultQuantity": {
"type": "number"
"type": ["null", "number"]
},
"pricePeriod": {
"type": "string"
"type": ["null", "string"]
},
"usageRating": {
"type": "string"
"type": ["null", "string"]
},
"createInvoiceLinesPerTier": {
"type": "boolean"
"type": ["null", "boolean"]
},
"billingDay": {
"type": "string"
"type": ["null", "string"]
},
"specificBillingDay": {
"type": "number"
"type": ["null", "number"]
},
"billingPeriod": {
"type": "string"
"type": ["null", "string"]
},
"periodAlignment": {
"type": "string"
"type": ["null", "string"]
},
"billingTiming": {
"type": "string"
"type": ["null", "string"]
},
"taxTemplate": {
"type": "string"
"type": ["null", "string"]
},
"taxIncluded": {
"type": "boolean"
"type": ["null", "boolean"]
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
},
"deferredRevenueAccount": {
"type": "string"
"type": ["null", "string"]
},
"recognizedRevenueAccount": {
"type": "string"
"type": ["null", "string"]
},
"customFields": {
"type": "object"
"type": ["null", "object"]
},
"priceDetails": {
"type": "array",
@@ -132,25 +133,25 @@
"type": "object",
"properties": {
"currency": {
"type": "string"
"type": ["null", "string"]
},
"price": {
"type": "number"
"type": ["null", "number"]
},
"tier": {
"type": "number"
"type": ["null", "number"]
},
"description": {
"type": "string"
"type": ["null", "string"]
},
"fromQuantity": {
"type": "number"
"type": ["null", "number"]
},
"toQuantity": {
"type": "number"
"type": ["null", "number"]
},
"priceBase": {
"type": "string"
"type": ["null", "string"]
}
}
}
@@ -162,13 +163,13 @@
}
},
"externalERPId": {
"type": "string"
"type": ["null", "string"]
},
"externalCRMId": {
"type": "string"
"type": ["null", "string"]
},
"customFields": {
"type": "object"
"type": ["null", "object"]
}
}
}

View File

@@ -64,6 +64,24 @@ class YouniumStream(HttpStream, ABC):
yield from response_results.get("data", [])
class Account(YouniumStream):
primary_key = "id"
def path(
self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> str:
return "Accounts"
class Booking(YouniumStream):
primary_key = "id"
def path(
self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> str:
return "Bookings"
class Invoice(YouniumStream):
primary_key = "id"
@@ -110,7 +128,6 @@ class SourceYounium(AbstractSource):
return auth
def check_connection(self, logger, config) -> Tuple[bool, any]:
try:
stream = Invoice(authenticator=self.get_auth(config), **config)
stream.next_page_token = lambda response: None
@@ -128,4 +145,10 @@ class SourceYounium(AbstractSource):
:param config: A Mapping of the user input configuration as defined in the connector spec.
"""
auth = self.get_auth(config)
return [Invoice(authenticator=auth, **config), Product(authenticator=auth, **config), Subscription(authenticator=auth, **config)]
return [
Account(authenticator=auth, **config),
Booking(authenticator=auth, **config),
Invoice(authenticator=auth, **config),
Product(authenticator=auth, **config),
Subscription(authenticator=auth, **config),
]

View File

@@ -47,5 +47,5 @@ def test_streams(mocker):
config_mock = {"playground": False, "username": "dummy_username", "password": "dummy_password"}
streams = source.streams(config_mock)
expected_streams_number = 3
expected_streams_number = 5
assert len(streams) == expected_streams_number

View File

@@ -33,12 +33,15 @@ The Younium source connector supports the following [sync modes](https://docs.ai
## Supported Streams
- [Accounts](https://developer.younium.com/api-details#api=Production_API2-0&operation=Get-Accounts)
- [Bookings](https://developer.younium.com/api-details#api=Production_API2-0&operation=Get-Bookings)
- [Subscriptions](https://developer.younium.com/api-details#api=Production_API2-0&operation=Get-Subscriptions)
- [Products](https://developer.younium.com/api-details#api=Production_API2-0&operation=Get-Products)
- [Invoices](https://developer.younium.com/api-details#api=Production_API2-0&operation=Get-Invoices)
## Changelog
| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :---------------------------------- |
| 0.1.0 | 2022-11-09 | [18758](https://github.com/airbytehq/airbyte/pull/18758) | 🎉 New Source: Younium [python cdk] |
| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- |:---------------------------------------------------|
| 0.2.0 | 2023-03-29 | [24655](https://github.com/airbytehq/airbyte/pull/24655) | Source Younium: Adding Booking and Account streams |
| 0.1.0 | 2022-11-09 | [18758](https://github.com/airbytehq/airbyte/pull/18758) | 🎉 New Source: Younium [python cdk] |

View File

@@ -29,6 +29,7 @@ import sys
from airbyte_cdk.models import AirbyteMessage, Type
from genson import SchemaBuilder
from genson.schema.strategies.object import Object
import genson.schema.strategies as strategies
class NoRequiredObj(Object):
@@ -63,6 +64,7 @@ def infer_schemas():
builders = {}
for line in sys.stdin:
print(line)
message = AirbyteMessage.parse_raw(line)
if message.type == Type.RECORD:
stream_name = message.record.stream