Sha256: a16ed9e0521dc5192fa2f389e9e85cba155864813de92c55db34b16d05248046

Contents?: true

Size: 1.15 KB

Versions: 18

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module WorkOS
  # The DirectoryGroup class provides a lightweight wrapper around
  # a WorkOS DirectoryGroup resource. This class is not meant to be instantiated
  # in user space, and is instantiated internally but exposed.
  class DirectoryGroup < DeprecatedHashWrapper
    include HashProvider

    attr_accessor :id, :directory_id, :idp_id, :name, :created_at, :updated_at,
                  :raw_attributes, :organization_id

    def initialize(json)
      hash = JSON.parse(json, symbolize_names: true)

      @id = hash[:id]
      @directory_id = hash[:directory_id]
      @organization_id = hash[:organization_id]
      @idp_id = hash[:idp_id]
      @name = hash[:name]
      @created_at = hash[:created_at]
      @updated_at = hash[:updated_at]
      @raw_attributes = hash[:raw_attributes]

      replace_without_warning(to_json)
    end

    def to_json(*)
      {
        id: id,
        directory_id: directory_id,
        organization_id: organization_id,
        idp_id: idp_id,
        name: name,
        created_at: created_at,
        updated_at: updated_at,
        raw_attributes: raw_attributes,
      }
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
workos-5.9.0 lib/workos/directory_group.rb
workos-5.8.0 lib/workos/directory_group.rb
workos-5.7.0 lib/workos/directory_group.rb
workos-5.6.0 lib/workos/directory_group.rb
workos-5.5.1 lib/workos/directory_group.rb
workos-5.5.0 lib/workos/directory_group.rb
workos-5.4.0 lib/workos/directory_group.rb
workos-5.3.0 lib/workos/directory_group.rb
workos-5.2.1 lib/workos/directory_group.rb
workos-5.2.0 lib/workos/directory_group.rb
workos-5.1.0 lib/workos/directory_group.rb
workos-5.0.0 lib/workos/directory_group.rb
workos-4.8.0 lib/workos/directory_group.rb
workos-4.5.0 lib/workos/directory_group.rb
workos-4.4.0 lib/workos/directory_group.rb
workos-4.3.0 lib/workos/directory_group.rb
workos-4.2.1 lib/workos/directory_group.rb
workos-4.2.0 lib/workos/directory_group.rb