Sha256: 3bf3fbb7d078ec6e748a6253c6c9a7dfa41ae09e304b52620f6856f8910f80dd

Contents?: true

Size: 1.78 KB

Versions: 12

Compression:

Stored size: 1.78 KB

Contents

# frozen_string_literal: true

module Seam
  module Clients
    class AccessCodesUnmanaged
      def initialize(client:, defaults:)
        @client = client
        @defaults = defaults
      end

      def convert_to_managed(access_code_id:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil, sync: nil)
        @client.post("/access_codes/unmanaged/convert_to_managed", {access_code_id: access_code_id, allow_external_modification: allow_external_modification, force: force, is_external_modification_allowed: is_external_modification_allowed, sync: sync}.compact)

        nil
      end

      def delete(access_code_id:, sync: nil)
        @client.post("/access_codes/unmanaged/delete", {access_code_id: access_code_id, sync: sync}.compact)

        nil
      end

      def get(access_code_id: nil, code: nil, device_id: nil)
        res = @client.post("/access_codes/unmanaged/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact)

        Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_code"])
      end

      def list(device_id:, user_identifier_key: nil)
        res = @client.post("/access_codes/unmanaged/list", {device_id: device_id, user_identifier_key: user_identifier_key}.compact)

        Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_codes"])
      end

      def update(access_code_id:, is_managed:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil)
        @client.post("/access_codes/unmanaged/update", {access_code_id: access_code_id, is_managed: is_managed, allow_external_modification: allow_external_modification, force: force, is_external_modification_allowed: is_external_modification_allowed}.compact)

        nil
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
seam-2.3.0 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.2.0 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.1.0 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.1 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0rc0 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0b5 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0b4 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0b3 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0b2 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0b1 lib/seam/routes/clients/access_codes_unmanaged.rb
seam-2.0.0b0 lib/seam/routes/clients/access_codes_unmanaged.rb