Sha256: 17db878f5ffb327ba6aa99a67a81c26f06053933ced78ae165172512a5d54cdd

Contents?: true

Size: 1.42 KB

Versions: 38

Compression:

Stored size: 1.42 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  module Entitlements
    # A feature represents a monetizable ability or functionality in your system.
    # Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.
    class Feature < APIResource
      extend Stripe::APIOperations::Create
      extend Stripe::APIOperations::List
      include Stripe::APIOperations::Save

      OBJECT_NAME = "entitlements.feature"
      def self.object_name
        "entitlements.feature"
      end

      # Creates a feature
      def self.create(params = {}, opts = {})
        request_stripe_object(
          method: :post,
          path: "/v1/entitlements/features",
          params: params,
          opts: opts
        )
      end

      # Retrieve a list of features
      def self.list(filters = {}, opts = {})
        request_stripe_object(
          method: :get,
          path: "/v1/entitlements/features",
          params: filters,
          opts: opts
        )
      end

      # Update a feature's metadata or permanently deactivate it.
      def self.update(id, params = {}, opts = {})
        request_stripe_object(
          method: :post,
          path: format("/v1/entitlements/features/%<id>s", { id: CGI.escape(id) }),
          params: params,
          opts: opts
        )
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
stripe-13.3.0.pre.beta.1 lib/stripe/resources/entitlements/feature.rb
stripe-13.2.0 lib/stripe/resources/entitlements/feature.rb
stripe-13.1.2 lib/stripe/resources/entitlements/feature.rb
stripe-13.2.0.pre.beta.3 lib/stripe/resources/entitlements/feature.rb
stripe-13.2.0.pre.beta.2 lib/stripe/resources/entitlements/feature.rb
stripe-13.1.1 lib/stripe/resources/entitlements/feature.rb
stripe-13.2.0.pre.beta.1 lib/stripe/resources/entitlements/feature.rb
stripe-13.1.0 lib/stripe/resources/entitlements/feature.rb
stripe-13.0.2 lib/stripe/resources/entitlements/feature.rb
stripe-13.1.0.pre.beta.3 lib/stripe/resources/entitlements/feature.rb
stripe-13.0.1 lib/stripe/resources/entitlements/feature.rb
stripe-13.1.0.pre.beta.2 lib/stripe/resources/entitlements/feature.rb
stripe-13.0.0 lib/stripe/resources/entitlements/feature.rb
stripe-12.7.0.pre.beta.2 lib/stripe/resources/entitlements/feature.rb
stripe-12.7.0.pre.beta.1 lib/stripe/resources/entitlements/feature.rb
stripe-12.6.0 lib/stripe/resources/entitlements/feature.rb
stripe-12.6.0.pre.beta.1 lib/stripe/resources/entitlements/feature.rb
stripe-12.5.0 lib/stripe/resources/entitlements/feature.rb
stripe-12.5.0.pre.beta.2 lib/stripe/resources/entitlements/feature.rb
stripe-12.5.0.pre.beta.1 lib/stripe/resources/entitlements/feature.rb