Sha256: 97d5a4fd0dedc1641b4c98fb5aef31242ff54407218ae1ebf4bd52652580cdf1

Contents?: true

Size: 1006 Bytes

Versions: 6

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

module Telnyx
  class SimCard < APIResource
    include Telnyx::APIOperations::Save
    extend APIOperations::NestedResource
    extend APIOperations::List

    ACTIONS = %w[enable disable].freeze
    ACTIONS.each do |action|
      nested_resource_class_methods action,
                                    path: %W[actions #{action}],
                                    operations: [:create],
                                    instance_methods: { create: action }
    end

    def self.register(params = {}, opts = {})
      resp, opts = request(:post, "/v2/actions/register/sim_cards", params, opts)
      Util.convert_to_telnyx_object(resp.data, opts)
    end

    OBJECT_NAME = "sim_card".freeze

    # depreciated api
    def activate
      warn "[DEPRECATION] SimCard#activate is deprecated, use enable instead."
      enable
    end

    def deactivate
      warn "[DEPRECATION] SimCard#deactivate is deprecated, use enable instead."
      disable
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
telnyx-2.9.0 lib/telnyx/sim_card.rb
telnyx-2.8.0 lib/telnyx/sim_card.rb
telnyx-2.7.0 lib/telnyx/sim_card.rb
telnyx-2.6.0 lib/telnyx/sim_card.rb
telnyx-2.5.0 lib/telnyx/sim_card.rb
telnyx-2.4.0 lib/telnyx/sim_card.rb