Class: Increase::Resources::FileLinks

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/file_links.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ FileLinks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FileLinks.

Parameters:



36
37
38
# File 'lib/increase/resources/file_links.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#create(file_id: , expires_at: nil, request_options: {}) ⇒ Increase::Models::FileLink

Some parameter documentations has been truncated, see Models::FileLinkCreateParams for more details.

Create a File Link

Parameters:

  • file_id (String)

    The File to create a File Link for.

  • expires_at (Time)

    The time at which the File Link will expire. The default is 1 hour from the time

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/increase/resources/file_links.rb', line 22

def create(params)
  parsed, options = Increase::FileLinkCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "file_links",
    body: parsed,
    model: Increase::FileLink,
    options: options
  )
end