Class: Google::Apis::PhotoslibraryV1::MediaItem

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/photoslibrary_v1/classes.rb,
generated/google/apis/photoslibrary_v1/representations.rb,
generated/google/apis/photoslibrary_v1/representations.rb

Overview

Representation of a media item (e.g. photo, video etc.) in Google Photos.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ MediaItem

Returns a new instance of MediaItem



734
735
736
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 734

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#base_urlString

A URL to the media item's bytes. This should not be used as is. For example, '=w2048-h1024' will set the dimensions of a media item of type photo to have a width of 2048 px and height of 1024 px. Corresponds to the JSON property baseUrl

Returns:

  • (String)


697
698
699
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 697

def base_url
  @base_url
end

#contributor_infoGoogle::Apis::PhotoslibraryV1::ContributorInfo

Information about a user who contributed the media item. Note that this information is only included if the album containing the media item is shared, was created by you and you have the sharing scope. Corresponds to the JSON property contributorInfo



704
705
706
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 704

def contributor_info
  @contributor_info
end

#descriptionString

Description of the media item. This is shown to the user in the item's info section in the Google Photos app. Corresponds to the JSON property description

Returns:

  • (String)


710
711
712
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 710

def description
  @description
end

#idString

Identifier for the media item. This is a persistent identifier that can be used between sessions to identify this media item. Corresponds to the JSON property id

Returns:

  • (String)


716
717
718
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 716

def id
  @id
end

#media_metadataGoogle::Apis::PhotoslibraryV1::MediaMetadata

Metadata for a media item. Corresponds to the JSON property mediaMetadata



721
722
723
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 721

def 
  @media_metadata
end

#mime_typeString

MIME type of the media item. Corresponds to the JSON property mimeType

Returns:

  • (String)


726
727
728
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 726

def mime_type
  @mime_type
end

#product_urlString

Google Photos URL for the media item. This link will only be available to the user if they're signed in. Corresponds to the JSON property productUrl

Returns:

  • (String)


732
733
734
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 732

def product_url
  @product_url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



739
740
741
742
743
744
745
746
747
# File 'generated/google/apis/photoslibrary_v1/classes.rb', line 739

def update!(**args)
  @base_url = args[:base_url] if args.key?(:base_url)
  @contributor_info = args[:contributor_info] if args.key?(:contributor_info)
  @description = args[:description] if args.key?(:description)
  @id = args[:id] if args.key?(:id)
  @media_metadata = args[:media_metadata] if args.key?(:media_metadata)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @product_url = args[:product_url] if args.key?(:product_url)
end