# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.

# typed: true
# frozen_string_literal: true

require 'sorbet-runtime'
require 'faraday'

module OpenApiSDK
  module Operations

    class GetSessionHistoryErrors < ::OpenApiSDK::Utils::FieldAugmented
      extend T::Sig


      field :code, T.nilable(Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('code') } }

      field :message, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('message') } }

      field :status, T.nilable(Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status') } }


      sig { params(code: T.nilable(Float), message: T.nilable(String), status: T.nilable(Float)).void }
      def initialize(code: nil, message: nil, status: nil)
        @code = code
        @message = message
        @status = status
      end
    end

    # Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
    class GetSessionHistorySessionsResponseBody < ::OpenApiSDK::Utils::FieldAugmented
      extend T::Sig


      field :errors, T.nilable(T::Array[Operations::GetSessionHistoryErrors]), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('errors') } }


      sig { params(errors: T.nilable(T::Array[Operations::GetSessionHistoryErrors])).void }
      def initialize(errors: nil)
        @errors = errors
      end
    end


    class GetSessionHistoryMetadata < ::OpenApiSDK::Utils::FieldAugmented
      extend T::Sig


      field :account_id, T.nilable(Integer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('accountID') } }

      field :device_id, T.nilable(Integer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('deviceID') } }

      field :grandparent_art, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('grandparentArt') } }

      field :grandparent_key, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('grandparentKey') } }

      field :grandparent_thumb, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('grandparentThumb') } }

      field :grandparent_title, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('grandparentTitle') } }

      field :history_key, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('historyKey') } }

      field :index, T.nilable(Integer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('index') } }

      field :key, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('key') } }

      field :library_section_id, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('librarySectionID') } }

      field :originally_available_at, T.nilable(Date), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('originallyAvailableAt'), 'decoder': Utils.date_from_iso_format(true) } }

      field :parent_index, T.nilable(Integer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('parentIndex') } }

      field :parent_key, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('parentKey') } }

      field :parent_thumb, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('parentThumb') } }

      field :rating_key, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('ratingKey') } }

      field :thumb, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('thumb') } }

      field :title, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('title') } }

      field :type, T.nilable(String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type') } }

      field :viewed_at, T.nilable(Integer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('viewedAt') } }


      sig { params(account_id: T.nilable(Integer), device_id: T.nilable(Integer), grandparent_art: T.nilable(String), grandparent_key: T.nilable(String), grandparent_thumb: T.nilable(String), grandparent_title: T.nilable(String), history_key: T.nilable(String), index: T.nilable(Integer), key: T.nilable(String), library_section_id: T.nilable(String), originally_available_at: T.nilable(Date), parent_index: T.nilable(Integer), parent_key: T.nilable(String), parent_thumb: T.nilable(String), rating_key: T.nilable(String), thumb: T.nilable(String), title: T.nilable(String), type: T.nilable(String), viewed_at: T.nilable(Integer)).void }
      def initialize(account_id: nil, device_id: nil, grandparent_art: nil, grandparent_key: nil, grandparent_thumb: nil, grandparent_title: nil, history_key: nil, index: nil, key: nil, library_section_id: nil, originally_available_at: nil, parent_index: nil, parent_key: nil, parent_thumb: nil, rating_key: nil, thumb: nil, title: nil, type: nil, viewed_at: nil)
        @account_id = account_id
        @device_id = device_id
        @grandparent_art = grandparent_art
        @grandparent_key = grandparent_key
        @grandparent_thumb = grandparent_thumb
        @grandparent_title = grandparent_title
        @history_key = history_key
        @index = index
        @key = key
        @library_section_id = library_section_id
        @originally_available_at = originally_available_at
        @parent_index = parent_index
        @parent_key = parent_key
        @parent_thumb = parent_thumb
        @rating_key = rating_key
        @thumb = thumb
        @title = title
        @type = type
        @viewed_at = viewed_at
      end
    end


    class GetSessionHistoryMediaContainer < ::OpenApiSDK::Utils::FieldAugmented
      extend T::Sig


      field :metadata, T.nilable(T::Array[Operations::GetSessionHistoryMetadata]), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('Metadata') } }

      field :size, T.nilable(Integer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('size') } }


      sig { params(metadata: T.nilable(T::Array[Operations::GetSessionHistoryMetadata]), size: T.nilable(Integer)).void }
      def initialize(metadata: nil, size: nil)
        @metadata = metadata
        @size = size
      end
    end

    # List of Plex Sessions
    class GetSessionHistoryResponseBody < ::OpenApiSDK::Utils::FieldAugmented
      extend T::Sig


      field :media_container, T.nilable(Operations::GetSessionHistoryMediaContainer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('MediaContainer') } }


      sig { params(media_container: T.nilable(Operations::GetSessionHistoryMediaContainer)).void }
      def initialize(media_container: nil)
        @media_container = media_container
      end
    end


    class GetSessionHistoryResponse < ::OpenApiSDK::Utils::FieldAugmented
      extend T::Sig

      # HTTP response content type for this operation
      field :content_type, String
      # Raw HTTP response; suitable for custom response parsing
      field :raw_response, Faraday::Response
      # HTTP response status code for this operation
      field :status_code, Integer
      # List of Plex Sessions
      field :two_hundred_application_json_object, T.nilable(Operations::GetSessionHistoryResponseBody)
      # Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
      field :four_hundred_and_one_application_json_object, T.nilable(Operations::GetSessionHistorySessionsResponseBody)


      sig { params(content_type: String, raw_response: Faraday::Response, status_code: Integer, two_hundred_application_json_object: T.nilable(Operations::GetSessionHistoryResponseBody), four_hundred_and_one_application_json_object: T.nilable(Operations::GetSessionHistorySessionsResponseBody)).void }
      def initialize(content_type: nil, raw_response: nil, status_code: nil, two_hundred_application_json_object: nil, four_hundred_and_one_application_json_object: nil)
        @content_type = content_type
        @raw_response = raw_response
        @status_code = status_code
        @two_hundred_application_json_object = two_hundred_application_json_object
        @four_hundred_and_one_application_json_object = four_hundred_and_one_application_json_object
      end
    end
  end
end
