fix: update models.py to align with the current API behavior#782
Draft
fix: update models.py to align with the current API behavior#782
Conversation
Sync SDK models with the new fully typed Pydantic models from apify-client-python PR #604. Key changes: - Add CommonActorPricingInfo base class with shared pricing fields - Add new models: ActorRunUsageUsd, Metamorph, PricingModel enum, GeneralAccessEnum - Add missing fields: migration_count, reboot_count, max_items, general_access, metamorphs, client_ip, user_agent, schedule_id, scheduled_at - Fix __model_config__ → model_config (was not applying config) - Add extra='allow' for forward-compatibility with new API fields - Change Decimal → float for pricing fields to match API types - Change timedelta → int/float for duration/timeout fields - Change container_url from required to optional - Separate usage vs usage_usd into distinct models - Update _charging.py for Decimal→float type conversions - Update timeout field references in integration tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add all response fields from the client's Webhook model (id, created_at, modified_at, user_id, condition, ignore_ssl_errors, do_not_retry, headers_template, description, last_dispatch, stats) as optional fields for backward compatibility. Add supporting models: WebhookCondition, WebhookDispatchStatus, ExampleWebhookDispatch, WebhookStats. Also add proper aliases (eventTypes, requestUrl, payloadTemplate) to existing required fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #782 +/- ##
==========================================
+ Coverage 81.86% 82.37% +0.51%
==========================================
Files 46 46
Lines 2696 2774 +78
==========================================
+ Hits 2207 2285 +78
Misses 489 489
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #778