Class: Google::Apis::DriveV2::Revision

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

Overview

A revision of a file. Some resource methods (such as revisions.update) require a revisionId. Use the revisions.list method to retrieve the ID for a revision.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Revision

Returns a new instance of Revision.



4119
4120
4121
# File 'lib/google/apis/drive_v2/classes.rb', line 4119

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

Instance Attribute Details

#download_urlString

Output only. Short term download URL for the file. This will only be populated on files with content stored in Drive. Corresponds to the JSON property downloadUrl

Returns:

  • (String)


4015
4016
4017
# File 'lib/google/apis/drive_v2/classes.rb', line 4015

def download_url
  @download_url
end

#etagString

Output only. The ETag of the revision. Corresponds to the JSON property etag

Returns:

  • (String)


4020
4021
4022
# File 'lib/google/apis/drive_v2/classes.rb', line 4020

def etag
  @etag
end

Output only. Links for exporting Docs Editors files to specific formats. Corresponds to the JSON property exportLinks

Returns:

  • (Hash<String,String>)


4025
4026
4027
# File 'lib/google/apis/drive_v2/classes.rb', line 4025

def export_links
  @export_links
end

#file_sizeFixnum

Output only. The size of the revision in bytes. This will only be populated on files with content stored in Drive. Corresponds to the JSON property fileSize

Returns:

  • (Fixnum)


4031
4032
4033
# File 'lib/google/apis/drive_v2/classes.rb', line 4031

def file_size
  @file_size
end

#idString

Output only. The ID of the revision. Corresponds to the JSON property id

Returns:

  • (String)


4036
4037
4038
# File 'lib/google/apis/drive_v2/classes.rb', line 4036

def id
  @id
end

#kindString

Output only. This is always drive#revision. Corresponds to the JSON property kind

Returns:

  • (String)


4041
4042
4043
# File 'lib/google/apis/drive_v2/classes.rb', line 4041

def kind
  @kind
end

#last_modifying_userGoogle::Apis::DriveV2::User

Information about a Drive user. Corresponds to the JSON property lastModifyingUser



4046
4047
4048
# File 'lib/google/apis/drive_v2/classes.rb', line 4046

def last_modifying_user
  @last_modifying_user
end

#last_modifying_user_nameString

Output only. Name of the last user to modify this revision. Corresponds to the JSON property lastModifyingUserName

Returns:

  • (String)


4051
4052
4053
# File 'lib/google/apis/drive_v2/classes.rb', line 4051

def last_modifying_user_name
  @last_modifying_user_name
end

#md5_checksumString

Output only. An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. Corresponds to the JSON property md5Checksum

Returns:

  • (String)


4057
4058
4059
# File 'lib/google/apis/drive_v2/classes.rb', line 4057

def md5_checksum
  @md5_checksum
end

#mime_typeString

Output only. The MIME type of the revision. Corresponds to the JSON property mimeType

Returns:

  • (String)


4062
4063
4064
# File 'lib/google/apis/drive_v2/classes.rb', line 4062

def mime_type
  @mime_type
end

#modified_dateDateTime

Last time this revision was modified (formatted RFC 3339 timestamp). Corresponds to the JSON property modifiedDate

Returns:

  • (DateTime)


4067
4068
4069
# File 'lib/google/apis/drive_v2/classes.rb', line 4067

def modified_date
  @modified_date
end

#original_filenameString

Output only. The original filename when this revision was created. This will only be populated on files with content stored in Drive. Corresponds to the JSON property originalFilename

Returns:

  • (String)


4073
4074
4075
# File 'lib/google/apis/drive_v2/classes.rb', line 4073

def original_filename
  @original_filename
end

#pinnedBoolean Also known as: pinned?

Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. Corresponds to the JSON property pinned

Returns:

  • (Boolean)


4084
4085
4086
# File 'lib/google/apis/drive_v2/classes.rb', line 4084

def pinned
  @pinned
end

#publish_autoBoolean Also known as: publish_auto?

Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. Corresponds to the JSON property publishAuto

Returns:

  • (Boolean)


4091
4092
4093
# File 'lib/google/apis/drive_v2/classes.rb', line 4091

def publish_auto
  @publish_auto
end

#publishedBoolean Also known as: published?

Whether this revision is published. This is only populated and can only be modified for Docs Editors files. Corresponds to the JSON property published

Returns:

  • (Boolean)


4098
4099
4100
# File 'lib/google/apis/drive_v2/classes.rb', line 4098

def published
  @published
end

Output only. A link to the published revision. This is only populated for Google Sites files. Corresponds to the JSON property publishedLink

Returns:

  • (String)


4105
4106
4107
# File 'lib/google/apis/drive_v2/classes.rb', line 4105

def published_link
  @published_link
end

#published_outside_domainBoolean Also known as: published_outside_domain?

Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. Corresponds to the JSON property publishedOutsideDomain

Returns:

  • (Boolean)


4111
4112
4113
# File 'lib/google/apis/drive_v2/classes.rb', line 4111

def published_outside_domain
  @published_outside_domain
end

Output only. A link back to this revision. Corresponds to the JSON property selfLink

Returns:

  • (String)


4117
4118
4119
# File 'lib/google/apis/drive_v2/classes.rb', line 4117

def self_link
  @self_link
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
# File 'lib/google/apis/drive_v2/classes.rb', line 4124

def update!(**args)
  @download_url = args[:download_url] if args.key?(:download_url)
  @etag = args[:etag] if args.key?(:etag)
  @export_links = args[:export_links] if args.key?(:export_links)
  @file_size = args[:file_size] if args.key?(:file_size)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @last_modifying_user = args[:last_modifying_user] if args.key?(:last_modifying_user)
  @last_modifying_user_name = args[:last_modifying_user_name] if args.key?(:last_modifying_user_name)
  @md5_checksum = args[:md5_checksum] if args.key?(:md5_checksum)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @modified_date = args[:modified_date] if args.key?(:modified_date)
  @original_filename = args[:original_filename] if args.key?(:original_filename)
  @pinned = args[:pinned] if args.key?(:pinned)
  @publish_auto = args[:publish_auto] if args.key?(:publish_auto)
  @published = args[:published] if args.key?(:published)
  @published_link = args[:published_link] if args.key?(:published_link)
  @published_outside_domain = args[:published_outside_domain] if args.key?(:published_outside_domain)
  @self_link = args[:self_link] if args.key?(:self_link)
end