Class List Method List File List

# Class: Com::Vmware::Content::Library::Item::Downloadsession::File

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Content::Library::Item::Downloadsession::File
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item/downloadsession.rb

## Overview

The ``Com::Vmware::Content::Library::Item::Downloadsession::File`` class provides methods for accessing files within a download session.

     After a download session is created against a library item, the  ``Com::Vmware::Content::Library::Item::Downloadsession::File``   class  can be used to retrieve all downloadable content within the library item. Since the content may not be available immediately in a downloadable form on the server side, the client will have to prepare the file and wait for the file status to become   :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::PrepareStatus.PREPARED`  .

     See   :class:`Com::Vmware::Content::Library::Item::DownloadSession`  .

## Defined Under Namespace

Classes: EndpointType, Info, PrepareStatus

## Instance Method Summary (collapse)

- - (Com::Vmware::Content::Library::Item::Downloadsession::File::Info) get(download_session_id, file_name)

  Retrieves file download information for a specific file.

- - (File) initialize(config) constructor

  Constructs a new instance.

- - (Array<Com::Vmware::Content::Library::Item::Downloadsession::File::Info>) list(download_session_id)

  Lists the information of all the files in the library item associated with the download session.

- - (Com::Vmware::Content::Library::Item::Downloadsession::File::Info) prepare(download_session_id, file_name, endpoint_type = nil)

  Requests a file to be prepared for download.

## Constructor Details

### - (`File`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    92
    93
    94
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item/downloadsession.rb', line 92

    def initialize(config)
        super(config, @@service_info)
    end

## Instance Method Details

### - (`Com::Vmware::Content::Library::Item::Downloadsession::File::Info`) get(download_session_id, file_name)

Retrieves file download information for a specific file.

Parameters:

- download_session_id (`String`) —

  Identifier of the download session.

- file_name (`String`) —

  Name of the file requested.

Returns:

- (`Com::Vmware::Content::Library::Item::Downloadsession::File::Info`) —

  The :class:`Com::Vmware::Content::Library::Item::Downloadsession::File::Info` instance containing the status of the file and its download link if available.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the download session associated with ``download_session_id`` does not exist.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if there is no file with the specified ``file_name`` .

    150
    151
    152
    153
    154
    155
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item/downloadsession.rb', line 150

    def get(download_session_id, file_name)
        invoke_with_info(@@get_info, {
            'download_session_id' => download_session_id,
            'file_name' => file_name,
        })
    end

### - (`Array<Com::Vmware::Content::Library::Item::Downloadsession::File::Info>`) list(download_session_id)

Lists the information of all the files in the library item associated with the download session.

Parameters:

- download_session_id (`String`) —

  Identifier of the download session.

Returns:

- (`Array<Com::Vmware::Content::Library::Item::Downloadsession::File::Info>`) —

  The list of :class:`Com::Vmware::Content::Library::Item::Downloadsession::File::Info` instances.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the download session associated with ``download_session_id`` doesn’t exist.

    105
    106
    107
    108
    109
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item/downloadsession.rb', line 105

    def list(download_session_id)
        invoke_with_info(@@list_info, {
            'download_session_id' => download_session_id,
        })
    end

### - (`Com::Vmware::Content::Library::Item::Downloadsession::File::Info`) prepare(download_session_id, file_name, endpoint_type = nil)

Requests a file to be prepared for download.

        If not specified the default is   :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType.HTTPS`  .

Parameters:

- download_session_id (`String`) —

  Identifier of the download session.

- file_name (`String`) —

  Name of the file requested for download.

- endpoint_type (`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType`, `nil`) (defaults to: `nil`) —

  Endpoint type request, one of ``HTTPS``, ``DIRECT`` . This will determine the type of the :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::Info.download_endpoint` that is generated when the file is prepared. The :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType.DIRECT` is only available to users who have the ContentLibrary.ReadStorage privilege.

Returns:

- (`Com::Vmware::Content::Library::Item::Downloadsession::File::Info`) —

  File information containing the status of the request and the download link to the file.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the download session does not exist.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if there is no file with the specified ``file_name`` .

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if the the download session wasn’t created with the ContentLibrary.ReadStorage privilege and the caller requested a :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType.DIRECT` endpoint type.

    129
    130
    131
    132
    133
    134
    135
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item/downloadsession.rb', line 129

    def prepare(download_session_id, file_name, endpoint_type=nil)
        invoke_with_info(@@prepare_info, {
            'download_session_id' => download_session_id,
            'file_name' => file_name,
            'endpoint_type' => endpoint_type,
        })
    end