From d772aaf7d65f69ee9101bbd092bebaeb2b2cb118 Mon Sep 17 00:00:00 2001 From: Brooke Kuhlmann Date: Mon, 21 Apr 2025 19:59:39 -0600 Subject: [PATCH] Added current screen response contract Necessary to validate the current screen API response. --- lib/trmnl/api/contracts/current_screen.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/trmnl/api/contracts/current_screen.rb diff --git a/lib/trmnl/api/contracts/current_screen.rb b/lib/trmnl/api/contracts/current_screen.rb new file mode 100644 index 0000000..f2fda7b --- /dev/null +++ b/lib/trmnl/api/contracts/current_screen.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require "dry/schema" + +module TRMNL + module API + module Contracts + # Validates API response. + CurrentScreen = Dry::Schema.JSON do + required(:refresh_rate).filled :integer + required(:image_url).filled :string + required(:filename).filled :string + end + end + end +end