Class: Contentful::Management::Upload

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::Refresher, Resource::SystemProperties
Defined in:
lib/contentful/management/upload.rb

Overview

Resource class for Upload.

See Also:

  • https://www.contentful.com/developers/docs/references/content-management-api/#/reference/uploads

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #properties, #raw_object, #request

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource::Refresher

#reload

Methods included from Resource

#array?, #default_locale, #destroy, #environment_id, #fields, #nested_locale_fields?, #resource?, #save, #sys, #update

Class Method Details

.create(client, space_id, attributes = {}) ⇒ Contentful::Management::Upload

Creates an upload.

Parameters:

Returns:

See Also:

  • README for full attribute list for each resource.


27
28
29
# File 'lib/contentful/management/upload.rb', line 27

def self.create(client, space_id, attributes = {})
  super(client, space_id, nil, attributes)
end

.find(client, space_id, upload_id) ⇒ Contentful::Management::Upload

Finds an upload by ID.

Parameters:

Returns:



38
39
40
# File 'lib/contentful/management/upload.rb', line 38

def self.find(client, space_id, upload_id)
  super(client, space_id, nil, upload_id)
end

Instance Method Details

Gets [Contentful::Management::Link]-like representation of the upload This is used in particular for associating the upload with an asset

Returns:

  • (Hash)

    link-like representation of the upload



56
57
58
59
60
61
62
63
64
# File 'lib/contentful/management/upload.rb', line 56

def to_link_json
  {
    sys: {
      type: 'Link',
      linkType: 'Upload',
      id: id
    }
  }
end