Sha256: bfa0804c6fa5280836ea2cbc26688c2913cd4ec8e2af0149ef2cfc2e5e0591d9

Contents?: true

Size: 1.51 KB

Versions: 17

Compression:

Stored size: 1.51 KB

Contents

module OpenStax
  module Accounts
    module Api
      module V1
        class ApplicationGroupRepresenter < 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 group with this application",
                     required: true
                   }

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

          property :group,
                   instance: ->(*) do
                     OpenStax::Accounts::Group.new.tap{ |group| group.syncing = true }
                   end,
                   decorator: GroupRepresenter,
                   schema_info: {
                     description: "The associated group",
                     required: true
                   }

          property :unread_updates,
                   type: Integer,
                   schema_info: {
                     description: "The number of updates applied to the associated group unread by the associated application",
                     required: true
                   }

        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
openstax_accounts-8.1.1 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-8.1.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-8.0.1 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-8.0.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.13.1 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.13.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.12.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.11.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.10.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.9.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.8.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.7.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.6.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.5.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.4.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.3.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb
openstax_accounts-7.2.0 app/representers/openstax/accounts/api/v1/application_group_representer.rb