Sha256: 40389a3070494b964974bd9b9d603ac7a9ac7af67503eda725bb424218228dff

Contents?: true

Size: 1.5 KB

Versions: 13

Compression:

Stored size: 1.5 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  class ProductFeatureService < StripeService
    # Creates a product_feature, which represents a feature attachment to a product
    def create(product, params = {}, opts = {})
      request(
        method: :post,
        path: format("/v1/products/%<product>s/features", { product: CGI.escape(product) }),
        params: params,
        opts: opts,
        base_address: :api
      )
    end

    # Deletes the feature attachment to a product
    def delete(product, id, params = {}, opts = {})
      request(
        method: :delete,
        path: format("/v1/products/%<product>s/features/%<id>s", { product: CGI.escape(product), id: CGI.escape(id) }),
        params: params,
        opts: opts,
        base_address: :api
      )
    end

    # Retrieve a list of features for a product
    def list(product, params = {}, opts = {})
      request(
        method: :get,
        path: format("/v1/products/%<product>s/features", { product: CGI.escape(product) }),
        params: params,
        opts: opts,
        base_address: :api
      )
    end

    # Retrieves a product_feature, which represents a feature attachment to a product
    def retrieve(product, id, params = {}, opts = {})
      request(
        method: :get,
        path: format("/v1/products/%<product>s/features/%<id>s", { product: CGI.escape(product), id: CGI.escape(id) }),
        params: params,
        opts: opts,
        base_address: :api
      )
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
stripe-13.3.0.pre.beta.1 lib/stripe/services/product_feature_service.rb
stripe-13.2.0 lib/stripe/services/product_feature_service.rb
stripe-13.1.2 lib/stripe/services/product_feature_service.rb
stripe-13.2.0.pre.beta.3 lib/stripe/services/product_feature_service.rb
stripe-13.2.0.pre.beta.2 lib/stripe/services/product_feature_service.rb
stripe-13.1.1 lib/stripe/services/product_feature_service.rb
stripe-13.2.0.pre.beta.1 lib/stripe/services/product_feature_service.rb
stripe-13.1.0 lib/stripe/services/product_feature_service.rb
stripe-13.0.2 lib/stripe/services/product_feature_service.rb
stripe-13.1.0.pre.beta.3 lib/stripe/services/product_feature_service.rb
stripe-13.0.1 lib/stripe/services/product_feature_service.rb
stripe-13.1.0.pre.beta.2 lib/stripe/services/product_feature_service.rb
stripe-13.0.0 lib/stripe/services/product_feature_service.rb