Sha256: 3012a07217e641ccb823030013fc53d9a51af1d844f9e6e09b6f7a87a0000ccd

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

module Seam
  module Clients
    class UnmanagedAccessCodes < BaseClient
      def get(access_code_id = nil, device_id: nil, code: nil)
        request_seam_object(
          :post,
          "/access_codes/unmanaged/get",
          Seam::UnmanagedAccessCode,
          "access_code",
          body: {
            device_id: device_id,
            access_code_id: access_code_id,
            code: code
          }.compact
        )
      end

      def list(device_id)
        request_seam_object(
          :post,
          "/access_codes/unmanaged/list",
          Seam::UnmanagedAccessCode,
          "access_codes",
          body: {device_id: device_id}
        )
      end

      def convert_to_managed(access_code_id, allow_external_modification: nil)
        action_attempt = request_seam_object(
          :post,
          "/access_codes/unmanaged/convert_to_managed",
          Seam::ActionAttempt,
          "action_attempt",
          body: {
            access_code_id: access_code_id,
            allow_external_modification: allow_external_modification
          }.compact
        )
        action_attempt.wait_until_finished
        action_attempt
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
seamapi-1.15.0 lib/seam/clients/unmanaged_access_codes.rb