Skip to content

Sync SDK with API spec: float duration, live recording flag, playback access restrictions (v1.2.0) - #10

Open
rohit-fastpix wants to merge 8 commits into
mainfrom
feature/spec-sync-live-restrictions
Open

Sync SDK with API spec: float duration, live recording flag, playback access restrictions (v1.2.0)#10
rohit-fastpix wants to merge 8 commits into
mainfrom
feature/spec-sync-live-restrictions

Conversation

@rohit-fastpix

Copy link
Copy Markdown
Collaborator

FastPix Python SDK - Documentation PR

This PR is a full SDK sync with the updated OpenAPI spec (code + docs + tests), released as v1.2.0. Documentation sections below cover the doc half; code changes are summarized at the end.

Documentation Changes

What Changed

  • New documentation added
  • Existing documentation updated
  • Documentation errors fixed
  • Code examples updated
  • Links and references updated
  • Other: test-harness README rewritten, tests/.env.example added

Files Modified

  • README.md
  • docs/ files
  • USAGE.md
  • CONTRIBUTING.md
  • Other: CHANGELOG.md, tests/README.md, tests/.env.example, examples/live_streaming.py

Summary

Brief description of changes:

Docs synced with the API spec changes shipped in v1.2.0:

- Media `duration` documented as float seconds (was "HH:MM:SS" string) across
  media.md, mediaclipresponsedata.md, playlistbyidresponsemedialistitem.md and
  the five legacy media-response pages still linked from the docs tree.
- `enable_recording` documented on InputMediaSettings and added to the
  create-stream example in docs/sdks/startlivestream.
- `access_restrictions` documented on PlaybackIDRequest, PlaybackSettings and
  PlaybackIDSuccessResponseData, with a worked example in docs/sdks/liveplayback.
- Ten new model pages for the live domain / user-agent restriction endpoints,
  two new operation sections in docs/sdks/liveplayback, and README index entries.
- CHANGELOG entry for 1.2.0 (breaking / added / fixed).
- tests/README.md rewritten to describe the current pytest suites and live
  validation harness; the stale embedded January report and the removed
  Node-based workflow instructions are gone. tests/.env.example added.

Code Examples (if Applicable)

from fastpix_python import Fastpix, models

fastpix = Fastpix(
    security=models.Security(username="your-username", password="your-password")
)

# Create a live stream; recording to VOD is on by default, opt out with enable_recording=False
stream = fastpix.start_live_stream.create_new_stream(
    playback_settings={"access_policy": "public"},
    input_media_settings={"max_resolution": "1080p", "enable_recording": True},
)

# Create a playback ID with domain/user-agent restrictions
playback = fastpix.live_playback.create_playback_id_of_stream(
    stream_id=stream.data.stream_id,
    access_policy="public",
    access_restrictions={
        "domains": {"default_policy": "deny", "allow": ["example.com"], "deny": []},
        "user_agents": {"default_policy": "allow", "allow": [], "deny": []},
    },
)

# Update restrictions on an existing live playback ID (new endpoints)
fastpix.live_playback.update_live_stream_domain_restrictions(
    stream_id=stream.data.stream_id,
    playback_id=playback.data.id,
    default_policy="deny",
    allow=["example.com"],
)

# Media duration is now a float (seconds)
media = fastpix.manage_videos.get_media(media_id="your-media-id")
print(media.duration)  # e.g. 145.821315

Testing

  • All code examples tested — tests/test_examples.py passes; examples/live_streaming.py exercised against the dev workspace
  • Links verified — tests/check_broken_links.py run; only pre-existing external 404s remain (API base URLs that reject GET, one old changelog link)
  • Grammar checked
  • Formatting consistent

Review Checklist

  • Content is accurate — every documented field/endpoint was validated live against dev (39/40 non-GET, all changed GETs pass; the one failure is an upstream API bug, see below)
  • Code examples work
  • Links are working
  • Grammar is correct
  • Formatting is consistent

Ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant