Sha256: 1bfea252eaf4092ff53a1043801f1fa560eb782bdf533097a5bacdd99cb3255f

Contents?: true

Size: 996 Bytes

Versions: 18

Compression:

Stored size: 996 Bytes

Contents

# frozen_string_literal: true

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

    attr_accessor :id, :domains, :name, :allow_profiles_outside_organization, :created_at, :updated_at

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

      @id = hash[:id]
      @name = hash[:name]
      @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization]
      @domains = hash[:domains]
      @created_at = hash[:created_at]
      @updated_at = hash[:updated_at]
    end

    def to_json(*)
      {
        id: id,
        name: name,
        allow_profiles_outside_organization: allow_profiles_outside_organization,
        domains: domains,
        created_at: created_at,
        updated_at: updated_at,
      }
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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