Class: Contentful::Management::Upload
- Inherits:
-
Object
- Object
- Contentful::Management::Upload
- Includes:
- Resource, Resource::Refresher, Resource::SystemProperties
- Defined in:
- lib/contentful/management/upload.rb
Overview
Resource class for Upload.
Instance Attribute Summary
Attributes included from Resource::SystemProperties
Attributes included from Resource
#client, #properties, #raw_object, #request
Class Method Summary collapse
-
.create(client, space_id, attributes = {}) ⇒ Contentful::Management::Upload
Creates an upload.
-
.find(client, space_id, upload_id) ⇒ Contentful::Management::Upload
Finds an upload by ID.
Instance Method Summary collapse
-
#to_link_json ⇒ Hash
Gets [Contentful::Management::Link]-like representation of the upload This is used in particular for associating the upload with an asset.
Methods included from Resource::Refresher
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.
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.
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
#to_link_json ⇒ Hash
Gets [Contentful::Management::Link]-like representation of the upload This is used in particular for associating the upload with an asset
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 |