Sha256: 25a51e62355fe7b32a4f514f3f03c50bfc5ece11ab6030a75fd610895d5d6887

Contents?: true

Size: 1.78 KB

Versions: 35

Compression:

Stored size: 1.78 KB

Contents

module OpenStax
  module Accounts
    module Api
      module V1
        class ApplicationAccountRepresenter < Roar::Decorator

          # This representer is used to communicate with Accounts
          # and so must allow read/write on all properties
          # Do not use it in create/update APIs!

          include Roar::JSON

          property :id,
                   type: Integer,
                   schema_info: {
                     description: "A unique ID number for the record that associates this account with this application",
                     required: true
                   }

          property :application_id,
                   type: Integer,
                   schema_info: {
                     description: "The associated application's unique ID number",
                     required: true
                   }

          property :account,
                   as: :user,
                   instance: ->(*) do
                     OpenStax::Accounts::Account.new.tap{ |account| account.syncing = true }
                   end,
                   decorator: AccountRepresenter,
                   schema_info: {
                     description: "The associated account",
                     required: true
                   }

          property :unread_updates,
                   type: Integer,
                   schema_info: {
                     description: "The number of profile updates from the associated account unread by the associated application",
                     required: true
                   }

          property :default_contact_info_id,
                   type: Integer,
                   schema_info: {
                     description: "The ID of the associated account's default contact info"
                   }

        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
openstax_accounts-9.9.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.8.1 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.8.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.7.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.6.1 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.6.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.5.1 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.5.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.4.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.3.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.0.5 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.0.4 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.2.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.0.3 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.1.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.0.2 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.0.1 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-9.0.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-8.1.1 app/representers/openstax/accounts/api/v1/application_account_representer.rb
openstax_accounts-8.1.0 app/representers/openstax/accounts/api/v1/application_account_representer.rb