diff --git a/src/finch/resources/access_tokens.py b/src/finch/resources/access_tokens.py index 0256050b..68668295 100644 --- a/src/finch/resources/access_tokens.py +++ b/src/finch/resources/access_tokens.py @@ -126,6 +126,8 @@ async def create( class AccessTokensWithRawResponse: def __init__(self, access_tokens: AccessTokens) -> None: + self._access_tokens = access_tokens + self.create = _legacy_response.to_raw_response_wrapper( access_tokens.create, ) @@ -133,6 +135,8 @@ def __init__(self, access_tokens: AccessTokens) -> None: class AsyncAccessTokensWithRawResponse: def __init__(self, access_tokens: AsyncAccessTokens) -> None: + self._access_tokens = access_tokens + self.create = _legacy_response.async_to_raw_response_wrapper( access_tokens.create, ) @@ -140,6 +144,8 @@ def __init__(self, access_tokens: AsyncAccessTokens) -> None: class AccessTokensWithStreamingResponse: def __init__(self, access_tokens: AccessTokens) -> None: + self._access_tokens = access_tokens + self.create = to_streamed_response_wrapper( access_tokens.create, ) @@ -147,6 +153,8 @@ def __init__(self, access_tokens: AccessTokens) -> None: class AsyncAccessTokensWithStreamingResponse: def __init__(self, access_tokens: AsyncAccessTokens) -> None: + self._access_tokens = access_tokens + self.create = async_to_streamed_response_wrapper( access_tokens.create, ) diff --git a/src/finch/resources/account.py b/src/finch/resources/account.py index 1906b838..4b69754c 100644 --- a/src/finch/resources/account.py +++ b/src/finch/resources/account.py @@ -123,6 +123,8 @@ async def introspect( class AccountWithRawResponse: def __init__(self, account: Account) -> None: + self._account = account + self.disconnect = _legacy_response.to_raw_response_wrapper( account.disconnect, ) @@ -133,6 +135,8 @@ def __init__(self, account: Account) -> None: class AsyncAccountWithRawResponse: def __init__(self, account: AsyncAccount) -> None: + self._account = account + self.disconnect = _legacy_response.async_to_raw_response_wrapper( account.disconnect, ) @@ -143,6 +147,8 @@ def __init__(self, account: AsyncAccount) -> None: class AccountWithStreamingResponse: def __init__(self, account: Account) -> None: + self._account = account + self.disconnect = to_streamed_response_wrapper( account.disconnect, ) @@ -153,6 +159,8 @@ def __init__(self, account: Account) -> None: class AsyncAccountWithStreamingResponse: def __init__(self, account: AsyncAccount) -> None: + self._account = account + self.disconnect = async_to_streamed_response_wrapper( account.disconnect, ) diff --git a/src/finch/resources/hris/benefits/benefits.py b/src/finch/resources/hris/benefits/benefits.py index d13caaa4..5e712445 100644 --- a/src/finch/resources/hris/benefits/benefits.py +++ b/src/finch/resources/hris/benefits/benefits.py @@ -407,7 +407,7 @@ def list_supported_benefits( class BenefitsWithRawResponse: def __init__(self, benefits: Benefits) -> None: - self.individuals = IndividualsWithRawResponse(benefits.individuals) + self._benefits = benefits self.create = _legacy_response.to_raw_response_wrapper( benefits.create, @@ -425,10 +425,14 @@ def __init__(self, benefits: Benefits) -> None: benefits.list_supported_benefits, ) + @cached_property + def individuals(self) -> IndividualsWithRawResponse: + return IndividualsWithRawResponse(self._benefits.individuals) + class AsyncBenefitsWithRawResponse: def __init__(self, benefits: AsyncBenefits) -> None: - self.individuals = AsyncIndividualsWithRawResponse(benefits.individuals) + self._benefits = benefits self.create = _legacy_response.async_to_raw_response_wrapper( benefits.create, @@ -446,10 +450,14 @@ def __init__(self, benefits: AsyncBenefits) -> None: benefits.list_supported_benefits, ) + @cached_property + def individuals(self) -> AsyncIndividualsWithRawResponse: + return AsyncIndividualsWithRawResponse(self._benefits.individuals) + class BenefitsWithStreamingResponse: def __init__(self, benefits: Benefits) -> None: - self.individuals = IndividualsWithStreamingResponse(benefits.individuals) + self._benefits = benefits self.create = to_streamed_response_wrapper( benefits.create, @@ -467,10 +475,14 @@ def __init__(self, benefits: Benefits) -> None: benefits.list_supported_benefits, ) + @cached_property + def individuals(self) -> IndividualsWithStreamingResponse: + return IndividualsWithStreamingResponse(self._benefits.individuals) + class AsyncBenefitsWithStreamingResponse: def __init__(self, benefits: AsyncBenefits) -> None: - self.individuals = AsyncIndividualsWithStreamingResponse(benefits.individuals) + self._benefits = benefits self.create = async_to_streamed_response_wrapper( benefits.create, @@ -487,3 +499,7 @@ def __init__(self, benefits: AsyncBenefits) -> None: self.list_supported_benefits = async_to_streamed_response_wrapper( benefits.list_supported_benefits, ) + + @cached_property + def individuals(self) -> AsyncIndividualsWithStreamingResponse: + return AsyncIndividualsWithStreamingResponse(self._benefits.individuals) diff --git a/src/finch/resources/hris/benefits/individuals.py b/src/finch/resources/hris/benefits/individuals.py index 9c866ad7..16664bac 100644 --- a/src/finch/resources/hris/benefits/individuals.py +++ b/src/finch/resources/hris/benefits/individuals.py @@ -398,6 +398,8 @@ def unenroll_many( class IndividualsWithRawResponse: def __init__(self, individuals: Individuals) -> None: + self._individuals = individuals + self.enroll_many = _legacy_response.to_raw_response_wrapper( individuals.enroll_many, ) @@ -414,6 +416,8 @@ def __init__(self, individuals: Individuals) -> None: class AsyncIndividualsWithRawResponse: def __init__(self, individuals: AsyncIndividuals) -> None: + self._individuals = individuals + self.enroll_many = _legacy_response.async_to_raw_response_wrapper( individuals.enroll_many, ) @@ -430,6 +434,8 @@ def __init__(self, individuals: AsyncIndividuals) -> None: class IndividualsWithStreamingResponse: def __init__(self, individuals: Individuals) -> None: + self._individuals = individuals + self.enroll_many = to_streamed_response_wrapper( individuals.enroll_many, ) @@ -446,6 +452,8 @@ def __init__(self, individuals: Individuals) -> None: class AsyncIndividualsWithStreamingResponse: def __init__(self, individuals: AsyncIndividuals) -> None: + self._individuals = individuals + self.enroll_many = async_to_streamed_response_wrapper( individuals.enroll_many, ) diff --git a/src/finch/resources/hris/company.py b/src/finch/resources/hris/company.py index 56570e7c..9180ef32 100644 --- a/src/finch/resources/hris/company.py +++ b/src/finch/resources/hris/company.py @@ -77,6 +77,8 @@ async def retrieve( class CompanyResourceWithRawResponse: def __init__(self, company: CompanyResource) -> None: + self._company = company + self.retrieve = _legacy_response.to_raw_response_wrapper( company.retrieve, ) @@ -84,6 +86,8 @@ def __init__(self, company: CompanyResource) -> None: class AsyncCompanyResourceWithRawResponse: def __init__(self, company: AsyncCompanyResource) -> None: + self._company = company + self.retrieve = _legacy_response.async_to_raw_response_wrapper( company.retrieve, ) @@ -91,6 +95,8 @@ def __init__(self, company: AsyncCompanyResource) -> None: class CompanyResourceWithStreamingResponse: def __init__(self, company: CompanyResource) -> None: + self._company = company + self.retrieve = to_streamed_response_wrapper( company.retrieve, ) @@ -98,6 +104,8 @@ def __init__(self, company: CompanyResource) -> None: class AsyncCompanyResourceWithStreamingResponse: def __init__(self, company: AsyncCompanyResource) -> None: + self._company = company + self.retrieve = async_to_streamed_response_wrapper( company.retrieve, ) diff --git a/src/finch/resources/hris/directory.py b/src/finch/resources/hris/directory.py index ef283cb9..4a9ac9b6 100644 --- a/src/finch/resources/hris/directory.py +++ b/src/finch/resources/hris/directory.py @@ -214,6 +214,8 @@ def list_individuals( class DirectoryWithRawResponse: def __init__(self, directory: Directory) -> None: + self._directory = directory + self.list = _legacy_response.to_raw_response_wrapper( directory.list, ) @@ -226,6 +228,8 @@ def __init__(self, directory: Directory) -> None: class AsyncDirectoryWithRawResponse: def __init__(self, directory: AsyncDirectory) -> None: + self._directory = directory + self.list = _legacy_response.async_to_raw_response_wrapper( directory.list, ) @@ -238,6 +242,8 @@ def __init__(self, directory: AsyncDirectory) -> None: class DirectoryWithStreamingResponse: def __init__(self, directory: Directory) -> None: + self._directory = directory + self.list = to_streamed_response_wrapper( directory.list, ) @@ -250,6 +256,8 @@ def __init__(self, directory: Directory) -> None: class AsyncDirectoryWithStreamingResponse: def __init__(self, directory: AsyncDirectory) -> None: + self._directory = directory + self.list = async_to_streamed_response_wrapper( directory.list, ) diff --git a/src/finch/resources/hris/employments.py b/src/finch/resources/hris/employments.py index ab9d375e..3b1f9cf3 100644 --- a/src/finch/resources/hris/employments.py +++ b/src/finch/resources/hris/employments.py @@ -124,6 +124,8 @@ def retrieve_many( class EmploymentsWithRawResponse: def __init__(self, employments: Employments) -> None: + self._employments = employments + self.retrieve_many = _legacy_response.to_raw_response_wrapper( employments.retrieve_many, ) @@ -131,6 +133,8 @@ def __init__(self, employments: Employments) -> None: class AsyncEmploymentsWithRawResponse: def __init__(self, employments: AsyncEmployments) -> None: + self._employments = employments + self.retrieve_many = _legacy_response.async_to_raw_response_wrapper( employments.retrieve_many, ) @@ -138,6 +142,8 @@ def __init__(self, employments: AsyncEmployments) -> None: class EmploymentsWithStreamingResponse: def __init__(self, employments: Employments) -> None: + self._employments = employments + self.retrieve_many = to_streamed_response_wrapper( employments.retrieve_many, ) @@ -145,6 +151,8 @@ def __init__(self, employments: Employments) -> None: class AsyncEmploymentsWithStreamingResponse: def __init__(self, employments: AsyncEmployments) -> None: + self._employments = employments + self.retrieve_many = async_to_streamed_response_wrapper( employments.retrieve_many, ) diff --git a/src/finch/resources/hris/hris.py b/src/finch/resources/hris/hris.py index 4cca0f46..8fd5751b 100644 --- a/src/finch/resources/hris/hris.py +++ b/src/finch/resources/hris/hris.py @@ -143,43 +143,131 @@ def with_streaming_response(self) -> AsyncHRISWithStreamingResponse: class HRISWithRawResponse: def __init__(self, hris: HRIS) -> None: - self.company = CompanyResourceWithRawResponse(hris.company) - self.directory = DirectoryWithRawResponse(hris.directory) - self.individuals = IndividualsWithRawResponse(hris.individuals) - self.employments = EmploymentsWithRawResponse(hris.employments) - self.payments = PaymentsWithRawResponse(hris.payments) - self.pay_statements = PayStatementsWithRawResponse(hris.pay_statements) - self.benefits = BenefitsWithRawResponse(hris.benefits) + self._hris = hris + + @cached_property + def company(self) -> CompanyResourceWithRawResponse: + return CompanyResourceWithRawResponse(self._hris.company) + + @cached_property + def directory(self) -> DirectoryWithRawResponse: + return DirectoryWithRawResponse(self._hris.directory) + + @cached_property + def individuals(self) -> IndividualsWithRawResponse: + return IndividualsWithRawResponse(self._hris.individuals) + + @cached_property + def employments(self) -> EmploymentsWithRawResponse: + return EmploymentsWithRawResponse(self._hris.employments) + + @cached_property + def payments(self) -> PaymentsWithRawResponse: + return PaymentsWithRawResponse(self._hris.payments) + + @cached_property + def pay_statements(self) -> PayStatementsWithRawResponse: + return PayStatementsWithRawResponse(self._hris.pay_statements) + + @cached_property + def benefits(self) -> BenefitsWithRawResponse: + return BenefitsWithRawResponse(self._hris.benefits) class AsyncHRISWithRawResponse: def __init__(self, hris: AsyncHRIS) -> None: - self.company = AsyncCompanyResourceWithRawResponse(hris.company) - self.directory = AsyncDirectoryWithRawResponse(hris.directory) - self.individuals = AsyncIndividualsWithRawResponse(hris.individuals) - self.employments = AsyncEmploymentsWithRawResponse(hris.employments) - self.payments = AsyncPaymentsWithRawResponse(hris.payments) - self.pay_statements = AsyncPayStatementsWithRawResponse(hris.pay_statements) - self.benefits = AsyncBenefitsWithRawResponse(hris.benefits) + self._hris = hris + + @cached_property + def company(self) -> AsyncCompanyResourceWithRawResponse: + return AsyncCompanyResourceWithRawResponse(self._hris.company) + + @cached_property + def directory(self) -> AsyncDirectoryWithRawResponse: + return AsyncDirectoryWithRawResponse(self._hris.directory) + + @cached_property + def individuals(self) -> AsyncIndividualsWithRawResponse: + return AsyncIndividualsWithRawResponse(self._hris.individuals) + + @cached_property + def employments(self) -> AsyncEmploymentsWithRawResponse: + return AsyncEmploymentsWithRawResponse(self._hris.employments) + + @cached_property + def payments(self) -> AsyncPaymentsWithRawResponse: + return AsyncPaymentsWithRawResponse(self._hris.payments) + + @cached_property + def pay_statements(self) -> AsyncPayStatementsWithRawResponse: + return AsyncPayStatementsWithRawResponse(self._hris.pay_statements) + + @cached_property + def benefits(self) -> AsyncBenefitsWithRawResponse: + return AsyncBenefitsWithRawResponse(self._hris.benefits) class HRISWithStreamingResponse: def __init__(self, hris: HRIS) -> None: - self.company = CompanyResourceWithStreamingResponse(hris.company) - self.directory = DirectoryWithStreamingResponse(hris.directory) - self.individuals = IndividualsWithStreamingResponse(hris.individuals) - self.employments = EmploymentsWithStreamingResponse(hris.employments) - self.payments = PaymentsWithStreamingResponse(hris.payments) - self.pay_statements = PayStatementsWithStreamingResponse(hris.pay_statements) - self.benefits = BenefitsWithStreamingResponse(hris.benefits) + self._hris = hris + + @cached_property + def company(self) -> CompanyResourceWithStreamingResponse: + return CompanyResourceWithStreamingResponse(self._hris.company) + + @cached_property + def directory(self) -> DirectoryWithStreamingResponse: + return DirectoryWithStreamingResponse(self._hris.directory) + + @cached_property + def individuals(self) -> IndividualsWithStreamingResponse: + return IndividualsWithStreamingResponse(self._hris.individuals) + + @cached_property + def employments(self) -> EmploymentsWithStreamingResponse: + return EmploymentsWithStreamingResponse(self._hris.employments) + + @cached_property + def payments(self) -> PaymentsWithStreamingResponse: + return PaymentsWithStreamingResponse(self._hris.payments) + + @cached_property + def pay_statements(self) -> PayStatementsWithStreamingResponse: + return PayStatementsWithStreamingResponse(self._hris.pay_statements) + + @cached_property + def benefits(self) -> BenefitsWithStreamingResponse: + return BenefitsWithStreamingResponse(self._hris.benefits) class AsyncHRISWithStreamingResponse: def __init__(self, hris: AsyncHRIS) -> None: - self.company = AsyncCompanyResourceWithStreamingResponse(hris.company) - self.directory = AsyncDirectoryWithStreamingResponse(hris.directory) - self.individuals = AsyncIndividualsWithStreamingResponse(hris.individuals) - self.employments = AsyncEmploymentsWithStreamingResponse(hris.employments) - self.payments = AsyncPaymentsWithStreamingResponse(hris.payments) - self.pay_statements = AsyncPayStatementsWithStreamingResponse(hris.pay_statements) - self.benefits = AsyncBenefitsWithStreamingResponse(hris.benefits) + self._hris = hris + + @cached_property + def company(self) -> AsyncCompanyResourceWithStreamingResponse: + return AsyncCompanyResourceWithStreamingResponse(self._hris.company) + + @cached_property + def directory(self) -> AsyncDirectoryWithStreamingResponse: + return AsyncDirectoryWithStreamingResponse(self._hris.directory) + + @cached_property + def individuals(self) -> AsyncIndividualsWithStreamingResponse: + return AsyncIndividualsWithStreamingResponse(self._hris.individuals) + + @cached_property + def employments(self) -> AsyncEmploymentsWithStreamingResponse: + return AsyncEmploymentsWithStreamingResponse(self._hris.employments) + + @cached_property + def payments(self) -> AsyncPaymentsWithStreamingResponse: + return AsyncPaymentsWithStreamingResponse(self._hris.payments) + + @cached_property + def pay_statements(self) -> AsyncPayStatementsWithStreamingResponse: + return AsyncPayStatementsWithStreamingResponse(self._hris.pay_statements) + + @cached_property + def benefits(self) -> AsyncBenefitsWithStreamingResponse: + return AsyncBenefitsWithStreamingResponse(self._hris.benefits) diff --git a/src/finch/resources/hris/individuals.py b/src/finch/resources/hris/individuals.py index dc8fb83f..93f37737 100644 --- a/src/finch/resources/hris/individuals.py +++ b/src/finch/resources/hris/individuals.py @@ -126,6 +126,8 @@ def retrieve_many( class IndividualsWithRawResponse: def __init__(self, individuals: Individuals) -> None: + self._individuals = individuals + self.retrieve_many = _legacy_response.to_raw_response_wrapper( individuals.retrieve_many, ) @@ -133,6 +135,8 @@ def __init__(self, individuals: Individuals) -> None: class AsyncIndividualsWithRawResponse: def __init__(self, individuals: AsyncIndividuals) -> None: + self._individuals = individuals + self.retrieve_many = _legacy_response.async_to_raw_response_wrapper( individuals.retrieve_many, ) @@ -140,6 +144,8 @@ def __init__(self, individuals: AsyncIndividuals) -> None: class IndividualsWithStreamingResponse: def __init__(self, individuals: Individuals) -> None: + self._individuals = individuals + self.retrieve_many = to_streamed_response_wrapper( individuals.retrieve_many, ) @@ -147,6 +153,8 @@ def __init__(self, individuals: Individuals) -> None: class AsyncIndividualsWithStreamingResponse: def __init__(self, individuals: AsyncIndividuals) -> None: + self._individuals = individuals + self.retrieve_many = async_to_streamed_response_wrapper( individuals.retrieve_many, ) diff --git a/src/finch/resources/hris/pay_statements.py b/src/finch/resources/hris/pay_statements.py index 0debe47d..4ede0e4e 100644 --- a/src/finch/resources/hris/pay_statements.py +++ b/src/finch/resources/hris/pay_statements.py @@ -126,6 +126,8 @@ def retrieve_many( class PayStatementsWithRawResponse: def __init__(self, pay_statements: PayStatements) -> None: + self._pay_statements = pay_statements + self.retrieve_many = _legacy_response.to_raw_response_wrapper( pay_statements.retrieve_many, ) @@ -133,6 +135,8 @@ def __init__(self, pay_statements: PayStatements) -> None: class AsyncPayStatementsWithRawResponse: def __init__(self, pay_statements: AsyncPayStatements) -> None: + self._pay_statements = pay_statements + self.retrieve_many = _legacy_response.async_to_raw_response_wrapper( pay_statements.retrieve_many, ) @@ -140,6 +144,8 @@ def __init__(self, pay_statements: AsyncPayStatements) -> None: class PayStatementsWithStreamingResponse: def __init__(self, pay_statements: PayStatements) -> None: + self._pay_statements = pay_statements + self.retrieve_many = to_streamed_response_wrapper( pay_statements.retrieve_many, ) @@ -147,6 +153,8 @@ def __init__(self, pay_statements: PayStatements) -> None: class AsyncPayStatementsWithStreamingResponse: def __init__(self, pay_statements: AsyncPayStatements) -> None: + self._pay_statements = pay_statements + self.retrieve_many = async_to_streamed_response_wrapper( pay_statements.retrieve_many, ) diff --git a/src/finch/resources/hris/payments.py b/src/finch/resources/hris/payments.py index 6ef8418f..66496a99 100644 --- a/src/finch/resources/hris/payments.py +++ b/src/finch/resources/hris/payments.py @@ -143,6 +143,8 @@ def list( class PaymentsWithRawResponse: def __init__(self, payments: Payments) -> None: + self._payments = payments + self.list = _legacy_response.to_raw_response_wrapper( payments.list, ) @@ -150,6 +152,8 @@ def __init__(self, payments: Payments) -> None: class AsyncPaymentsWithRawResponse: def __init__(self, payments: AsyncPayments) -> None: + self._payments = payments + self.list = _legacy_response.async_to_raw_response_wrapper( payments.list, ) @@ -157,6 +161,8 @@ def __init__(self, payments: AsyncPayments) -> None: class PaymentsWithStreamingResponse: def __init__(self, payments: Payments) -> None: + self._payments = payments + self.list = to_streamed_response_wrapper( payments.list, ) @@ -164,6 +170,8 @@ def __init__(self, payments: Payments) -> None: class AsyncPaymentsWithStreamingResponse: def __init__(self, payments: AsyncPayments) -> None: + self._payments = payments + self.list = async_to_streamed_response_wrapper( payments.list, ) diff --git a/src/finch/resources/jobs/automated.py b/src/finch/resources/jobs/automated.py index 3789d903..13b460ff 100644 --- a/src/finch/resources/jobs/automated.py +++ b/src/finch/resources/jobs/automated.py @@ -298,6 +298,8 @@ def list( class AutomatedWithRawResponse: def __init__(self, automated: Automated) -> None: + self._automated = automated + self.create = _legacy_response.to_raw_response_wrapper( automated.create, ) @@ -311,6 +313,8 @@ def __init__(self, automated: Automated) -> None: class AsyncAutomatedWithRawResponse: def __init__(self, automated: AsyncAutomated) -> None: + self._automated = automated + self.create = _legacy_response.async_to_raw_response_wrapper( automated.create, ) @@ -324,6 +328,8 @@ def __init__(self, automated: AsyncAutomated) -> None: class AutomatedWithStreamingResponse: def __init__(self, automated: Automated) -> None: + self._automated = automated + self.create = to_streamed_response_wrapper( automated.create, ) @@ -337,6 +343,8 @@ def __init__(self, automated: Automated) -> None: class AsyncAutomatedWithStreamingResponse: def __init__(self, automated: AsyncAutomated) -> None: + self._automated = automated + self.create = async_to_streamed_response_wrapper( automated.create, ) diff --git a/src/finch/resources/jobs/jobs.py b/src/finch/resources/jobs/jobs.py index da6edf59..ec354abd 100644 --- a/src/finch/resources/jobs/jobs.py +++ b/src/finch/resources/jobs/jobs.py @@ -62,23 +62,51 @@ def with_streaming_response(self) -> AsyncJobsWithStreamingResponse: class JobsWithRawResponse: def __init__(self, jobs: Jobs) -> None: - self.automated = AutomatedWithRawResponse(jobs.automated) - self.manual = ManualWithRawResponse(jobs.manual) + self._jobs = jobs + + @cached_property + def automated(self) -> AutomatedWithRawResponse: + return AutomatedWithRawResponse(self._jobs.automated) + + @cached_property + def manual(self) -> ManualWithRawResponse: + return ManualWithRawResponse(self._jobs.manual) class AsyncJobsWithRawResponse: def __init__(self, jobs: AsyncJobs) -> None: - self.automated = AsyncAutomatedWithRawResponse(jobs.automated) - self.manual = AsyncManualWithRawResponse(jobs.manual) + self._jobs = jobs + + @cached_property + def automated(self) -> AsyncAutomatedWithRawResponse: + return AsyncAutomatedWithRawResponse(self._jobs.automated) + + @cached_property + def manual(self) -> AsyncManualWithRawResponse: + return AsyncManualWithRawResponse(self._jobs.manual) class JobsWithStreamingResponse: def __init__(self, jobs: Jobs) -> None: - self.automated = AutomatedWithStreamingResponse(jobs.automated) - self.manual = ManualWithStreamingResponse(jobs.manual) + self._jobs = jobs + + @cached_property + def automated(self) -> AutomatedWithStreamingResponse: + return AutomatedWithStreamingResponse(self._jobs.automated) + + @cached_property + def manual(self) -> ManualWithStreamingResponse: + return ManualWithStreamingResponse(self._jobs.manual) class AsyncJobsWithStreamingResponse: def __init__(self, jobs: AsyncJobs) -> None: - self.automated = AsyncAutomatedWithStreamingResponse(jobs.automated) - self.manual = AsyncManualWithStreamingResponse(jobs.manual) + self._jobs = jobs + + @cached_property + def automated(self) -> AsyncAutomatedWithStreamingResponse: + return AsyncAutomatedWithStreamingResponse(self._jobs.automated) + + @cached_property + def manual(self) -> AsyncManualWithStreamingResponse: + return AsyncManualWithStreamingResponse(self._jobs.manual) diff --git a/src/finch/resources/jobs/manual.py b/src/finch/resources/jobs/manual.py index ad92165b..03195ea2 100644 --- a/src/finch/resources/jobs/manual.py +++ b/src/finch/resources/jobs/manual.py @@ -109,6 +109,8 @@ async def retrieve( class ManualWithRawResponse: def __init__(self, manual: Manual) -> None: + self._manual = manual + self.retrieve = _legacy_response.to_raw_response_wrapper( manual.retrieve, ) @@ -116,6 +118,8 @@ def __init__(self, manual: Manual) -> None: class AsyncManualWithRawResponse: def __init__(self, manual: AsyncManual) -> None: + self._manual = manual + self.retrieve = _legacy_response.async_to_raw_response_wrapper( manual.retrieve, ) @@ -123,6 +127,8 @@ def __init__(self, manual: AsyncManual) -> None: class ManualWithStreamingResponse: def __init__(self, manual: Manual) -> None: + self._manual = manual + self.retrieve = to_streamed_response_wrapper( manual.retrieve, ) @@ -130,6 +136,8 @@ def __init__(self, manual: Manual) -> None: class AsyncManualWithStreamingResponse: def __init__(self, manual: AsyncManual) -> None: + self._manual = manual + self.retrieve = async_to_streamed_response_wrapper( manual.retrieve, ) diff --git a/src/finch/resources/providers.py b/src/finch/resources/providers.py index ba090b6d..63a671f4 100644 --- a/src/finch/resources/providers.py +++ b/src/finch/resources/providers.py @@ -81,6 +81,8 @@ def list( class ProvidersWithRawResponse: def __init__(self, providers: Providers) -> None: + self._providers = providers + self.list = _legacy_response.to_raw_response_wrapper( providers.list, ) @@ -88,6 +90,8 @@ def __init__(self, providers: Providers) -> None: class AsyncProvidersWithRawResponse: def __init__(self, providers: AsyncProviders) -> None: + self._providers = providers + self.list = _legacy_response.async_to_raw_response_wrapper( providers.list, ) @@ -95,6 +99,8 @@ def __init__(self, providers: AsyncProviders) -> None: class ProvidersWithStreamingResponse: def __init__(self, providers: Providers) -> None: + self._providers = providers + self.list = to_streamed_response_wrapper( providers.list, ) @@ -102,6 +108,8 @@ def __init__(self, providers: Providers) -> None: class AsyncProvidersWithStreamingResponse: def __init__(self, providers: AsyncProviders) -> None: + self._providers = providers + self.list = async_to_streamed_response_wrapper( providers.list, ) diff --git a/src/finch/resources/request_forwarding.py b/src/finch/resources/request_forwarding.py index f89250fc..09595451 100644 --- a/src/finch/resources/request_forwarding.py +++ b/src/finch/resources/request_forwarding.py @@ -174,6 +174,8 @@ async def forward( class RequestForwardingWithRawResponse: def __init__(self, request_forwarding: RequestForwarding) -> None: + self._request_forwarding = request_forwarding + self.forward = _legacy_response.to_raw_response_wrapper( request_forwarding.forward, ) @@ -181,6 +183,8 @@ def __init__(self, request_forwarding: RequestForwarding) -> None: class AsyncRequestForwardingWithRawResponse: def __init__(self, request_forwarding: AsyncRequestForwarding) -> None: + self._request_forwarding = request_forwarding + self.forward = _legacy_response.async_to_raw_response_wrapper( request_forwarding.forward, ) @@ -188,6 +192,8 @@ def __init__(self, request_forwarding: AsyncRequestForwarding) -> None: class RequestForwardingWithStreamingResponse: def __init__(self, request_forwarding: RequestForwarding) -> None: + self._request_forwarding = request_forwarding + self.forward = to_streamed_response_wrapper( request_forwarding.forward, ) @@ -195,6 +201,8 @@ def __init__(self, request_forwarding: RequestForwarding) -> None: class AsyncRequestForwardingWithStreamingResponse: def __init__(self, request_forwarding: AsyncRequestForwarding) -> None: + self._request_forwarding = request_forwarding + self.forward = async_to_streamed_response_wrapper( request_forwarding.forward, ) diff --git a/src/finch/resources/sandbox/company.py b/src/finch/resources/sandbox/company.py index 531c8a71..8be8b220 100644 --- a/src/finch/resources/sandbox/company.py +++ b/src/finch/resources/sandbox/company.py @@ -173,6 +173,8 @@ async def update( class CompanyWithRawResponse: def __init__(self, company: Company) -> None: + self._company = company + self.update = _legacy_response.to_raw_response_wrapper( company.update, ) @@ -180,6 +182,8 @@ def __init__(self, company: Company) -> None: class AsyncCompanyWithRawResponse: def __init__(self, company: AsyncCompany) -> None: + self._company = company + self.update = _legacy_response.async_to_raw_response_wrapper( company.update, ) @@ -187,6 +191,8 @@ def __init__(self, company: AsyncCompany) -> None: class CompanyWithStreamingResponse: def __init__(self, company: Company) -> None: + self._company = company + self.update = to_streamed_response_wrapper( company.update, ) @@ -194,6 +200,8 @@ def __init__(self, company: Company) -> None: class AsyncCompanyWithStreamingResponse: def __init__(self, company: AsyncCompany) -> None: + self._company = company + self.update = async_to_streamed_response_wrapper( company.update, ) diff --git a/src/finch/resources/sandbox/connections/accounts.py b/src/finch/resources/sandbox/connections/accounts.py index 14770673..dd582bd4 100644 --- a/src/finch/resources/sandbox/connections/accounts.py +++ b/src/finch/resources/sandbox/connections/accounts.py @@ -209,6 +209,8 @@ async def update( class AccountsWithRawResponse: def __init__(self, accounts: Accounts) -> None: + self._accounts = accounts + self.create = _legacy_response.to_raw_response_wrapper( accounts.create, ) @@ -219,6 +221,8 @@ def __init__(self, accounts: Accounts) -> None: class AsyncAccountsWithRawResponse: def __init__(self, accounts: AsyncAccounts) -> None: + self._accounts = accounts + self.create = _legacy_response.async_to_raw_response_wrapper( accounts.create, ) @@ -229,6 +233,8 @@ def __init__(self, accounts: AsyncAccounts) -> None: class AccountsWithStreamingResponse: def __init__(self, accounts: Accounts) -> None: + self._accounts = accounts + self.create = to_streamed_response_wrapper( accounts.create, ) @@ -239,6 +245,8 @@ def __init__(self, accounts: Accounts) -> None: class AsyncAccountsWithStreamingResponse: def __init__(self, accounts: AsyncAccounts) -> None: + self._accounts = accounts + self.create = async_to_streamed_response_wrapper( accounts.create, ) diff --git a/src/finch/resources/sandbox/connections/connections.py b/src/finch/resources/sandbox/connections/connections.py index 5fa11a27..e499940e 100644 --- a/src/finch/resources/sandbox/connections/connections.py +++ b/src/finch/resources/sandbox/connections/connections.py @@ -151,35 +151,51 @@ async def create( class ConnectionsWithRawResponse: def __init__(self, connections: Connections) -> None: - self.accounts = AccountsWithRawResponse(connections.accounts) + self._connections = connections self.create = _legacy_response.to_raw_response_wrapper( connections.create, ) + @cached_property + def accounts(self) -> AccountsWithRawResponse: + return AccountsWithRawResponse(self._connections.accounts) + class AsyncConnectionsWithRawResponse: def __init__(self, connections: AsyncConnections) -> None: - self.accounts = AsyncAccountsWithRawResponse(connections.accounts) + self._connections = connections self.create = _legacy_response.async_to_raw_response_wrapper( connections.create, ) + @cached_property + def accounts(self) -> AsyncAccountsWithRawResponse: + return AsyncAccountsWithRawResponse(self._connections.accounts) + class ConnectionsWithStreamingResponse: def __init__(self, connections: Connections) -> None: - self.accounts = AccountsWithStreamingResponse(connections.accounts) + self._connections = connections self.create = to_streamed_response_wrapper( connections.create, ) + @cached_property + def accounts(self) -> AccountsWithStreamingResponse: + return AccountsWithStreamingResponse(self._connections.accounts) + class AsyncConnectionsWithStreamingResponse: def __init__(self, connections: AsyncConnections) -> None: - self.accounts = AsyncAccountsWithStreamingResponse(connections.accounts) + self._connections = connections self.create = async_to_streamed_response_wrapper( connections.create, ) + + @cached_property + def accounts(self) -> AsyncAccountsWithStreamingResponse: + return AsyncAccountsWithStreamingResponse(self._connections.accounts) diff --git a/src/finch/resources/sandbox/directory.py b/src/finch/resources/sandbox/directory.py index eb904c93..b9093be9 100644 --- a/src/finch/resources/sandbox/directory.py +++ b/src/finch/resources/sandbox/directory.py @@ -112,6 +112,8 @@ async def create( class DirectoryWithRawResponse: def __init__(self, directory: Directory) -> None: + self._directory = directory + self.create = _legacy_response.to_raw_response_wrapper( directory.create, ) @@ -119,6 +121,8 @@ def __init__(self, directory: Directory) -> None: class AsyncDirectoryWithRawResponse: def __init__(self, directory: AsyncDirectory) -> None: + self._directory = directory + self.create = _legacy_response.async_to_raw_response_wrapper( directory.create, ) @@ -126,6 +130,8 @@ def __init__(self, directory: AsyncDirectory) -> None: class DirectoryWithStreamingResponse: def __init__(self, directory: Directory) -> None: + self._directory = directory + self.create = to_streamed_response_wrapper( directory.create, ) @@ -133,6 +139,8 @@ def __init__(self, directory: Directory) -> None: class AsyncDirectoryWithStreamingResponse: def __init__(self, directory: AsyncDirectory) -> None: + self._directory = directory + self.create = async_to_streamed_response_wrapper( directory.create, ) diff --git a/src/finch/resources/sandbox/employment.py b/src/finch/resources/sandbox/employment.py index 2c3f20cd..a26f8cf9 100644 --- a/src/finch/resources/sandbox/employment.py +++ b/src/finch/resources/sandbox/employment.py @@ -247,6 +247,8 @@ async def update( class EmploymentWithRawResponse: def __init__(self, employment: Employment) -> None: + self._employment = employment + self.update = _legacy_response.to_raw_response_wrapper( employment.update, ) @@ -254,6 +256,8 @@ def __init__(self, employment: Employment) -> None: class AsyncEmploymentWithRawResponse: def __init__(self, employment: AsyncEmployment) -> None: + self._employment = employment + self.update = _legacy_response.async_to_raw_response_wrapper( employment.update, ) @@ -261,6 +265,8 @@ def __init__(self, employment: AsyncEmployment) -> None: class EmploymentWithStreamingResponse: def __init__(self, employment: Employment) -> None: + self._employment = employment + self.update = to_streamed_response_wrapper( employment.update, ) @@ -268,6 +274,8 @@ def __init__(self, employment: Employment) -> None: class AsyncEmploymentWithStreamingResponse: def __init__(self, employment: AsyncEmployment) -> None: + self._employment = employment + self.update = async_to_streamed_response_wrapper( employment.update, ) diff --git a/src/finch/resources/sandbox/individual.py b/src/finch/resources/sandbox/individual.py index 7094fe7b..5aa93cc6 100644 --- a/src/finch/resources/sandbox/individual.py +++ b/src/finch/resources/sandbox/individual.py @@ -236,6 +236,8 @@ async def update( class IndividualWithRawResponse: def __init__(self, individual: Individual) -> None: + self._individual = individual + self.update = _legacy_response.to_raw_response_wrapper( individual.update, ) @@ -243,6 +245,8 @@ def __init__(self, individual: Individual) -> None: class AsyncIndividualWithRawResponse: def __init__(self, individual: AsyncIndividual) -> None: + self._individual = individual + self.update = _legacy_response.async_to_raw_response_wrapper( individual.update, ) @@ -250,6 +254,8 @@ def __init__(self, individual: AsyncIndividual) -> None: class IndividualWithStreamingResponse: def __init__(self, individual: Individual) -> None: + self._individual = individual + self.update = to_streamed_response_wrapper( individual.update, ) @@ -257,6 +263,8 @@ def __init__(self, individual: Individual) -> None: class AsyncIndividualWithStreamingResponse: def __init__(self, individual: AsyncIndividual) -> None: + self._individual = individual + self.update = async_to_streamed_response_wrapper( individual.update, ) diff --git a/src/finch/resources/sandbox/jobs/configuration.py b/src/finch/resources/sandbox/jobs/configuration.py index aa35738b..de8e1c18 100644 --- a/src/finch/resources/sandbox/jobs/configuration.py +++ b/src/finch/resources/sandbox/jobs/configuration.py @@ -158,6 +158,8 @@ async def update( class ConfigurationWithRawResponse: def __init__(self, configuration: Configuration) -> None: + self._configuration = configuration + self.retrieve = _legacy_response.to_raw_response_wrapper( configuration.retrieve, ) @@ -168,6 +170,8 @@ def __init__(self, configuration: Configuration) -> None: class AsyncConfigurationWithRawResponse: def __init__(self, configuration: AsyncConfiguration) -> None: + self._configuration = configuration + self.retrieve = _legacy_response.async_to_raw_response_wrapper( configuration.retrieve, ) @@ -178,6 +182,8 @@ def __init__(self, configuration: AsyncConfiguration) -> None: class ConfigurationWithStreamingResponse: def __init__(self, configuration: Configuration) -> None: + self._configuration = configuration + self.retrieve = to_streamed_response_wrapper( configuration.retrieve, ) @@ -188,6 +194,8 @@ def __init__(self, configuration: Configuration) -> None: class AsyncConfigurationWithStreamingResponse: def __init__(self, configuration: AsyncConfiguration) -> None: + self._configuration = configuration + self.retrieve = async_to_streamed_response_wrapper( configuration.retrieve, ) diff --git a/src/finch/resources/sandbox/jobs/jobs.py b/src/finch/resources/sandbox/jobs/jobs.py index 799e9661..916e4057 100644 --- a/src/finch/resources/sandbox/jobs/jobs.py +++ b/src/finch/resources/sandbox/jobs/jobs.py @@ -46,19 +46,35 @@ def with_streaming_response(self) -> AsyncJobsWithStreamingResponse: class JobsWithRawResponse: def __init__(self, jobs: Jobs) -> None: - self.configuration = ConfigurationWithRawResponse(jobs.configuration) + self._jobs = jobs + + @cached_property + def configuration(self) -> ConfigurationWithRawResponse: + return ConfigurationWithRawResponse(self._jobs.configuration) class AsyncJobsWithRawResponse: def __init__(self, jobs: AsyncJobs) -> None: - self.configuration = AsyncConfigurationWithRawResponse(jobs.configuration) + self._jobs = jobs + + @cached_property + def configuration(self) -> AsyncConfigurationWithRawResponse: + return AsyncConfigurationWithRawResponse(self._jobs.configuration) class JobsWithStreamingResponse: def __init__(self, jobs: Jobs) -> None: - self.configuration = ConfigurationWithStreamingResponse(jobs.configuration) + self._jobs = jobs + + @cached_property + def configuration(self) -> ConfigurationWithStreamingResponse: + return ConfigurationWithStreamingResponse(self._jobs.configuration) class AsyncJobsWithStreamingResponse: def __init__(self, jobs: AsyncJobs) -> None: - self.configuration = AsyncConfigurationWithStreamingResponse(jobs.configuration) + self._jobs = jobs + + @cached_property + def configuration(self) -> AsyncConfigurationWithStreamingResponse: + return AsyncConfigurationWithStreamingResponse(self._jobs.configuration) diff --git a/src/finch/resources/sandbox/payment.py b/src/finch/resources/sandbox/payment.py index 04d9e05d..020de8b8 100644 --- a/src/finch/resources/sandbox/payment.py +++ b/src/finch/resources/sandbox/payment.py @@ -124,6 +124,8 @@ async def create( class PaymentWithRawResponse: def __init__(self, payment: Payment) -> None: + self._payment = payment + self.create = _legacy_response.to_raw_response_wrapper( payment.create, ) @@ -131,6 +133,8 @@ def __init__(self, payment: Payment) -> None: class AsyncPaymentWithRawResponse: def __init__(self, payment: AsyncPayment) -> None: + self._payment = payment + self.create = _legacy_response.async_to_raw_response_wrapper( payment.create, ) @@ -138,6 +142,8 @@ def __init__(self, payment: AsyncPayment) -> None: class PaymentWithStreamingResponse: def __init__(self, payment: Payment) -> None: + self._payment = payment + self.create = to_streamed_response_wrapper( payment.create, ) @@ -145,6 +151,8 @@ def __init__(self, payment: Payment) -> None: class AsyncPaymentWithStreamingResponse: def __init__(self, payment: AsyncPayment) -> None: + self._payment = payment + self.create = async_to_streamed_response_wrapper( payment.create, ) diff --git a/src/finch/resources/sandbox/sandbox.py b/src/finch/resources/sandbox/sandbox.py index 6c208e89..9daf72aa 100644 --- a/src/finch/resources/sandbox/sandbox.py +++ b/src/finch/resources/sandbox/sandbox.py @@ -144,43 +144,131 @@ def with_streaming_response(self) -> AsyncSandboxWithStreamingResponse: class SandboxWithRawResponse: def __init__(self, sandbox: Sandbox) -> None: - self.connections = ConnectionsWithRawResponse(sandbox.connections) - self.company = CompanyWithRawResponse(sandbox.company) - self.directory = DirectoryWithRawResponse(sandbox.directory) - self.individual = IndividualWithRawResponse(sandbox.individual) - self.employment = EmploymentWithRawResponse(sandbox.employment) - self.payment = PaymentWithRawResponse(sandbox.payment) - self.jobs = JobsWithRawResponse(sandbox.jobs) + self._sandbox = sandbox + + @cached_property + def connections(self) -> ConnectionsWithRawResponse: + return ConnectionsWithRawResponse(self._sandbox.connections) + + @cached_property + def company(self) -> CompanyWithRawResponse: + return CompanyWithRawResponse(self._sandbox.company) + + @cached_property + def directory(self) -> DirectoryWithRawResponse: + return DirectoryWithRawResponse(self._sandbox.directory) + + @cached_property + def individual(self) -> IndividualWithRawResponse: + return IndividualWithRawResponse(self._sandbox.individual) + + @cached_property + def employment(self) -> EmploymentWithRawResponse: + return EmploymentWithRawResponse(self._sandbox.employment) + + @cached_property + def payment(self) -> PaymentWithRawResponse: + return PaymentWithRawResponse(self._sandbox.payment) + + @cached_property + def jobs(self) -> JobsWithRawResponse: + return JobsWithRawResponse(self._sandbox.jobs) class AsyncSandboxWithRawResponse: def __init__(self, sandbox: AsyncSandbox) -> None: - self.connections = AsyncConnectionsWithRawResponse(sandbox.connections) - self.company = AsyncCompanyWithRawResponse(sandbox.company) - self.directory = AsyncDirectoryWithRawResponse(sandbox.directory) - self.individual = AsyncIndividualWithRawResponse(sandbox.individual) - self.employment = AsyncEmploymentWithRawResponse(sandbox.employment) - self.payment = AsyncPaymentWithRawResponse(sandbox.payment) - self.jobs = AsyncJobsWithRawResponse(sandbox.jobs) + self._sandbox = sandbox + + @cached_property + def connections(self) -> AsyncConnectionsWithRawResponse: + return AsyncConnectionsWithRawResponse(self._sandbox.connections) + + @cached_property + def company(self) -> AsyncCompanyWithRawResponse: + return AsyncCompanyWithRawResponse(self._sandbox.company) + + @cached_property + def directory(self) -> AsyncDirectoryWithRawResponse: + return AsyncDirectoryWithRawResponse(self._sandbox.directory) + + @cached_property + def individual(self) -> AsyncIndividualWithRawResponse: + return AsyncIndividualWithRawResponse(self._sandbox.individual) + + @cached_property + def employment(self) -> AsyncEmploymentWithRawResponse: + return AsyncEmploymentWithRawResponse(self._sandbox.employment) + + @cached_property + def payment(self) -> AsyncPaymentWithRawResponse: + return AsyncPaymentWithRawResponse(self._sandbox.payment) + + @cached_property + def jobs(self) -> AsyncJobsWithRawResponse: + return AsyncJobsWithRawResponse(self._sandbox.jobs) class SandboxWithStreamingResponse: def __init__(self, sandbox: Sandbox) -> None: - self.connections = ConnectionsWithStreamingResponse(sandbox.connections) - self.company = CompanyWithStreamingResponse(sandbox.company) - self.directory = DirectoryWithStreamingResponse(sandbox.directory) - self.individual = IndividualWithStreamingResponse(sandbox.individual) - self.employment = EmploymentWithStreamingResponse(sandbox.employment) - self.payment = PaymentWithStreamingResponse(sandbox.payment) - self.jobs = JobsWithStreamingResponse(sandbox.jobs) + self._sandbox = sandbox + + @cached_property + def connections(self) -> ConnectionsWithStreamingResponse: + return ConnectionsWithStreamingResponse(self._sandbox.connections) + + @cached_property + def company(self) -> CompanyWithStreamingResponse: + return CompanyWithStreamingResponse(self._sandbox.company) + + @cached_property + def directory(self) -> DirectoryWithStreamingResponse: + return DirectoryWithStreamingResponse(self._sandbox.directory) + + @cached_property + def individual(self) -> IndividualWithStreamingResponse: + return IndividualWithStreamingResponse(self._sandbox.individual) + + @cached_property + def employment(self) -> EmploymentWithStreamingResponse: + return EmploymentWithStreamingResponse(self._sandbox.employment) + + @cached_property + def payment(self) -> PaymentWithStreamingResponse: + return PaymentWithStreamingResponse(self._sandbox.payment) + + @cached_property + def jobs(self) -> JobsWithStreamingResponse: + return JobsWithStreamingResponse(self._sandbox.jobs) class AsyncSandboxWithStreamingResponse: def __init__(self, sandbox: AsyncSandbox) -> None: - self.connections = AsyncConnectionsWithStreamingResponse(sandbox.connections) - self.company = AsyncCompanyWithStreamingResponse(sandbox.company) - self.directory = AsyncDirectoryWithStreamingResponse(sandbox.directory) - self.individual = AsyncIndividualWithStreamingResponse(sandbox.individual) - self.employment = AsyncEmploymentWithStreamingResponse(sandbox.employment) - self.payment = AsyncPaymentWithStreamingResponse(sandbox.payment) - self.jobs = AsyncJobsWithStreamingResponse(sandbox.jobs) + self._sandbox = sandbox + + @cached_property + def connections(self) -> AsyncConnectionsWithStreamingResponse: + return AsyncConnectionsWithStreamingResponse(self._sandbox.connections) + + @cached_property + def company(self) -> AsyncCompanyWithStreamingResponse: + return AsyncCompanyWithStreamingResponse(self._sandbox.company) + + @cached_property + def directory(self) -> AsyncDirectoryWithStreamingResponse: + return AsyncDirectoryWithStreamingResponse(self._sandbox.directory) + + @cached_property + def individual(self) -> AsyncIndividualWithStreamingResponse: + return AsyncIndividualWithStreamingResponse(self._sandbox.individual) + + @cached_property + def employment(self) -> AsyncEmploymentWithStreamingResponse: + return AsyncEmploymentWithStreamingResponse(self._sandbox.employment) + + @cached_property + def payment(self) -> AsyncPaymentWithStreamingResponse: + return AsyncPaymentWithStreamingResponse(self._sandbox.payment) + + @cached_property + def jobs(self) -> AsyncJobsWithStreamingResponse: + return AsyncJobsWithStreamingResponse(self._sandbox.jobs)