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.



115
116
117
# File 'lib/stripe/services/file_link_service.rb', line 115

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.



120
121
122
# File 'lib/stripe/services/file_link_service.rb', line 120

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.



125
126
127
128
129
130
131
132
133
# File 'lib/stripe/services/file_link_service.rb', line 125

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.



136
137
138
139
140
141
142
143
144
# File 'lib/stripe/services/file_link_service.rb', line 136

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