Class: Stripe::FileLinkService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/file_link_service.rb

Defined Under Namespace

Classes: CreateParams, ListParams, RetrieveParams, UpdateParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#create(params = {}, opts = {}) ⇒ Object

Creates a new file link object.



101
102
103
# File 'lib/stripe/services/file_link_service.rb', line 101

def create(params = {}, opts = {})
  request(method: :post, path: "/v1/file_links", params: params, opts: opts, base_address: :api)
end

#list(params = {}, opts = {}) ⇒ Object

Returns a list of file links.



106
107
108
# File 'lib/stripe/services/file_link_service.rb', line 106

def list(params = {}, opts = {})
  request(method: :get, path: "/v1/file_links", params: params, opts: opts, base_address: :api)
end

#retrieve(link, params = {}, opts = {}) ⇒ Object

Retrieves the file link with the given ID.



111
112
113
114
115
116
117
118
119
# File 'lib/stripe/services/file_link_service.rb', line 111

def retrieve(link, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/file_links/%<link>s", { link: CGI.escape(link) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#update(link, params = {}, opts = {}) ⇒ Object

Updates an existing file link object. Expired links can no longer be updated.



122
123
124
125
126
127
128
129
130
# File 'lib/stripe/services/file_link_service.rb', line 122

def update(link, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/file_links/%<link>s", { link: CGI.escape(link) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end