drive  v2
Public Member Functions | Static Public Attributes | List of all members
google_drive_api::FilesResource_UpdateMethod Class Reference

#include <drive_service.h>

Inheritance diagram for google_drive_api::FilesResource_UpdateMethod:
google_drive_api::DriveServiceBaseRequest

Public Member Functions

 FilesResource_UpdateMethod (const DriveService *_service_, client::AuthorizationCredential *_credential_, const absl::string_view &file_id)
 
 FilesResource_UpdateMethod (const DriveService *_service_, client::AuthorizationCredential *_credential_, const absl::string_view &file_id, const File *_metadata_, const StringPiece &_media_content_type_, client::DataReader *_media_content_reader_)
 
virtual ~FilesResource_UpdateMethod ()
 
void clear_add_parents ()
 
const string & get_add_parents () const
 
string * mutable_addParents ()
 
void set_add_parents (const string &value)
 
void clear_convert ()
 
bool get_convert () const
 
void set_convert (bool value)
 
void clear_enforce_single_parent ()
 
bool get_enforce_single_parent () const
 
void set_enforce_single_parent (bool value)
 
void clear_modified_date_behavior ()
 
const string & get_modified_date_behavior () const
 
string * mutable_modifiedDateBehavior ()
 
void set_modified_date_behavior (const string &value)
 
void clear_new_revision ()
 
bool get_new_revision () const
 
void set_new_revision (bool value)
 
void clear_ocr ()
 
bool get_ocr () const
 
void set_ocr (bool value)
 
void clear_ocr_language ()
 
const string & get_ocr_language () const
 
string * mutable_ocrLanguage ()
 
void set_ocr_language (const string &value)
 
void clear_pinned ()
 
bool get_pinned () const
 
void set_pinned (bool value)
 
void clear_remove_parents ()
 
const string & get_remove_parents () const
 
string * mutable_removeParents ()
 
void set_remove_parents (const string &value)
 
void clear_set_modified_date ()
 
bool get_set_modified_date () const
 
void set_set_modified_date (bool value)
 
void clear_supports_all_drives ()
 
bool get_supports_all_drives () const
 
void set_supports_all_drives (bool value)
 
void clear_supports_team_drives ()
 
bool get_supports_team_drives () const
 
void set_supports_team_drives (bool value)
 
void clear_timed_text_language ()
 
const string & get_timed_text_language () const
 
string * mutable_timedTextLanguage ()
 
void set_timed_text_language (const string &value)
 
void clear_timed_text_track_name ()
 
const string & get_timed_text_track_name () const
 
string * mutable_timedTextTrackName ()
 
void set_timed_text_track_name (const string &value)
 
void clear_update_viewed_date ()
 
bool get_update_viewed_date () const
 
void set_update_viewed_date (bool value)
 
void clear_use_content_as_indexable_text ()
 
bool get_use_content_as_indexable_text () const
 
void set_use_content_as_indexable_text (bool value)
 
virtual util::Status AppendVariable (const StringPiece &variable_name, const client::UriTemplateConfig &config, string *target)
 
virtual util::Status AppendOptionalQueryParameters (string *target)
 
util::Status ExecuteAndParseResponse (File *data)
 
- Public Member Functions inherited from google_drive_api::DriveServiceBaseRequest
 DriveServiceBaseRequest (const client::ClientService *service, client::AuthorizationCredential *credential, client::HttpRequest::HttpMethod method, const StringPiece &uri_template)
 
virtual ~DriveServiceBaseRequest ()
 
void clear_alt ()
 
const string & get_alt () const
 
string * mutable_alt ()
 
void set_alt (const string &value)
 
void clear_fields ()
 
const string & get_fields () const
 
string * mutable_fields ()
 
void set_fields (const string &value)
 
void clear_key ()
 
const string & get_key () const
 
string * mutable_key ()
 
void set_key (const string &value)
 
void clear_oauth_token ()
 
const string & get_oauth_token () const
 
string * mutable_oauthToken ()
 
void set_oauth_token (const string &value)
 
void clear_pretty_print ()
 
bool get_pretty_print () const
 
void set_pretty_print (bool value)
 
void clear_quota_user ()
 
const string & get_quota_user () const
 
string * mutable_quotaUser ()
 
void set_quota_user (const string &value)
 
void clear_user_ip ()
 
const string & get_user_ip () const
 
string * mutable_userIp ()
 
void set_user_ip (const string &value)
 

Static Public Attributes

static const client::MediaUploadSpec SIMPLE_MEDIA_UPLOAD
 
static const client::MediaUploadSpec RESUMABLE_MEDIA_UPLOAD
 

Additional Inherited Members

- Protected Member Functions inherited from google_drive_api::DriveServiceBaseRequest
void AddJsonContentToRequest (const client::JsonCppData *content)
 

Detailed Description

Implements the update method.

This class uses the Command Pattern. Construct an instance with the required parameters, then set any additional optional parameters by using the attribute setters. To invoke the method, call Execute.

One or more of these authorization scopes are required for this method: https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.appdata https://www.googleapis.com/auth/drive.apps.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive.metadata https://www.googleapis.com/auth/drive.scripts

Constructor & Destructor Documentation

◆ FilesResource_UpdateMethod() [1/2]

google_drive_api::FilesResource_UpdateMethod::FilesResource_UpdateMethod ( const DriveService _service_,
client::AuthorizationCredential *  _credential_,
const absl::string_view &  file_id 
)

The standard constructor takes all the required method parameters.

Deprecated:
in favor constructor that includes the media upload parameters.
Parameters
[in]<em>service</em>The service instance to send to when executed.
[in]<em>credential</em>If not NULL, the credential to authorize with. In practice this is supplied by the user code that is creating the method instance.
[in]file_idThe ID of the file to update.
[in]<em>content</em>The data object to update.

◆ FilesResource_UpdateMethod() [2/2]

google_drive_api::FilesResource_UpdateMethod::FilesResource_UpdateMethod ( const DriveService _service_,
client::AuthorizationCredential *  _credential_,
const absl::string_view &  file_id,
const File _metadata_,
const StringPiece &  _media_content_type_,
client::DataReader *  _media_content_reader_ 
)

The standard constructor takes all the required method parameters.

Parameters
[in]<em>service</em>The service instance to send to when executed.
[in]<em>credential</em>If not NULL, the credential to authorize with. In practice this is supplied by the user code that is creating the method instance.
[in]file_idThe ID of the file to update.
[in]<em>metadata</em>The metadata object to update. If this is NULL then do not upload any metadata.
[in]<em>media_content_type</em>The content type of the data in the media_content_reader.
[in]<em>media_content_reader</em>The media content to update. If this is NULL then do not upload any media and ignore media_content_type.

◆ ~FilesResource_UpdateMethod()

google_drive_api::FilesResource_UpdateMethod::~FilesResource_UpdateMethod ( )
virtual

Standard destructor.

Member Function Documentation

◆ AppendOptionalQueryParameters()

util::Status google_drive_api::FilesResource_UpdateMethod::AppendOptionalQueryParameters ( string *  target)
virtual

Appends the optional query parameters to the target URL.

Parameters
[in,out]targetThe URL string to append to.

Reimplemented from google_drive_api::DriveServiceBaseRequest.

◆ AppendVariable()

util::Status google_drive_api::FilesResource_UpdateMethod::AppendVariable ( const StringPiece &  variable_name,
const client::UriTemplateConfig &  config,
string *  target 
)
virtual

Appends variable value to the target string.

This is a helper function used to resolve templated variables in the URI.

Parameters
[in]variable_nameThe name of the templated variable.
[in]configA pass-through parameter used for lists and maps.
[in,out]targetThe string to append the value to.

Reimplemented from google_drive_api::DriveServiceBaseRequest.

◆ clear_add_parents()

void google_drive_api::FilesResource_UpdateMethod::clear_add_parents ( )
inline

Clears the 'addParents' attribute so it is no longer set.

◆ clear_convert()

void google_drive_api::FilesResource_UpdateMethod::clear_convert ( )
inline

Clears the 'convert' attribute so it is no longer set.

◆ clear_enforce_single_parent()

void google_drive_api::FilesResource_UpdateMethod::clear_enforce_single_parent ( )
inline

Clears the 'enforceSingleParent' attribute so it is no longer set.

◆ clear_modified_date_behavior()

void google_drive_api::FilesResource_UpdateMethod::clear_modified_date_behavior ( )
inline

Clears the 'modifiedDateBehavior' attribute so it is no longer set.

◆ clear_new_revision()

void google_drive_api::FilesResource_UpdateMethod::clear_new_revision ( )
inline

Clears the 'newRevision' attribute so it is no longer set.

◆ clear_ocr()

void google_drive_api::FilesResource_UpdateMethod::clear_ocr ( )
inline

Clears the 'ocr' attribute so it is no longer set.

◆ clear_ocr_language()

void google_drive_api::FilesResource_UpdateMethod::clear_ocr_language ( )
inline

Clears the 'ocrLanguage' attribute so it is no longer set.

◆ clear_pinned()

void google_drive_api::FilesResource_UpdateMethod::clear_pinned ( )
inline

Clears the 'pinned' attribute so it is no longer set.

◆ clear_remove_parents()

void google_drive_api::FilesResource_UpdateMethod::clear_remove_parents ( )
inline

Clears the 'removeParents' attribute so it is no longer set.

◆ clear_set_modified_date()

void google_drive_api::FilesResource_UpdateMethod::clear_set_modified_date ( )
inline

Clears the 'setModifiedDate' attribute so it is no longer set.

◆ clear_supports_all_drives()

void google_drive_api::FilesResource_UpdateMethod::clear_supports_all_drives ( )
inline

Clears the 'supportsAllDrives' attribute so it is no longer set.

◆ clear_supports_team_drives()

void google_drive_api::FilesResource_UpdateMethod::clear_supports_team_drives ( )
inline

Clears the 'supportsTeamDrives' attribute so it is no longer set.

◆ clear_timed_text_language()

void google_drive_api::FilesResource_UpdateMethod::clear_timed_text_language ( )
inline

Clears the 'timedTextLanguage' attribute so it is no longer set.

◆ clear_timed_text_track_name()

void google_drive_api::FilesResource_UpdateMethod::clear_timed_text_track_name ( )
inline

Clears the 'timedTextTrackName' attribute so it is no longer set.

◆ clear_update_viewed_date()

void google_drive_api::FilesResource_UpdateMethod::clear_update_viewed_date ( )
inline

Clears the 'updateViewedDate' attribute so it is no longer set.

◆ clear_use_content_as_indexable_text()

void google_drive_api::FilesResource_UpdateMethod::clear_use_content_as_indexable_text ( )
inline

Clears the 'useContentAsIndexableText' attribute so it is no longer set.

◆ ExecuteAndParseResponse()

util::Status google_drive_api::FilesResource_UpdateMethod::ExecuteAndParseResponse ( File data)
inline

Executes the method and parses the response into a data object on success.

Parameters
[out]dataLoads from the response payload JSON data on success.
Returns
Success if an HTTP 2xx response was received. Otherwise the status indicates the reason for failure. Finer detail may be available from the underlying http_request to distinguish the transport_status from the overal HTTP request status.

◆ get_add_parents()

const string& google_drive_api::FilesResource_UpdateMethod::get_add_parents ( ) const
inline

Gets the optional 'addParents' attribute.

If the value is not set then the default value will be returned.

◆ get_convert()

bool google_drive_api::FilesResource_UpdateMethod::get_convert ( ) const
inline

Gets the optional 'convert' attribute.

If the value is not set then the default value will be returned.

◆ get_enforce_single_parent()

bool google_drive_api::FilesResource_UpdateMethod::get_enforce_single_parent ( ) const
inline

Gets the optional 'enforceSingleParent' attribute.

If the value is not set then the default value will be returned.

◆ get_modified_date_behavior()

const string& google_drive_api::FilesResource_UpdateMethod::get_modified_date_behavior ( ) const
inline

Gets the optional 'modifiedDateBehavior' attribute.

If the value is not set then the default value will be returned.

◆ get_new_revision()

bool google_drive_api::FilesResource_UpdateMethod::get_new_revision ( ) const
inline

Gets the optional 'newRevision' attribute.

If the value is not set then the default value will be returned.

◆ get_ocr()

bool google_drive_api::FilesResource_UpdateMethod::get_ocr ( ) const
inline

Gets the optional 'ocr' attribute.

If the value is not set then the default value will be returned.

◆ get_ocr_language()

const string& google_drive_api::FilesResource_UpdateMethod::get_ocr_language ( ) const
inline

Gets the optional 'ocrLanguage' attribute.

If the value is not set then the default value will be returned.

◆ get_pinned()

bool google_drive_api::FilesResource_UpdateMethod::get_pinned ( ) const
inline

Gets the optional 'pinned' attribute.

If the value is not set then the default value will be returned.

◆ get_remove_parents()

const string& google_drive_api::FilesResource_UpdateMethod::get_remove_parents ( ) const
inline

Gets the optional 'removeParents' attribute.

If the value is not set then the default value will be returned.

◆ get_set_modified_date()

bool google_drive_api::FilesResource_UpdateMethod::get_set_modified_date ( ) const
inline

Gets the optional 'setModifiedDate' attribute.

If the value is not set then the default value will be returned.

◆ get_supports_all_drives()

bool google_drive_api::FilesResource_UpdateMethod::get_supports_all_drives ( ) const
inline

Gets the optional 'supportsAllDrives' attribute.

If the value is not set then the default value will be returned.

◆ get_supports_team_drives()

bool google_drive_api::FilesResource_UpdateMethod::get_supports_team_drives ( ) const
inline

Gets the optional 'supportsTeamDrives' attribute.

If the value is not set then the default value will be returned.

◆ get_timed_text_language()

const string& google_drive_api::FilesResource_UpdateMethod::get_timed_text_language ( ) const
inline

Gets the optional 'timedTextLanguage' attribute.

If the value is not set then the default value will be returned.

◆ get_timed_text_track_name()

const string& google_drive_api::FilesResource_UpdateMethod::get_timed_text_track_name ( ) const
inline

Gets the optional 'timedTextTrackName' attribute.

If the value is not set then the default value will be returned.

◆ get_update_viewed_date()

bool google_drive_api::FilesResource_UpdateMethod::get_update_viewed_date ( ) const
inline

Gets the optional 'updateViewedDate' attribute.

If the value is not set then the default value will be returned.

◆ get_use_content_as_indexable_text()

bool google_drive_api::FilesResource_UpdateMethod::get_use_content_as_indexable_text ( ) const
inline

Gets the optional 'useContentAsIndexableText' attribute.

If the value is not set then the default value will be returned.

◆ mutable_addParents()

string* google_drive_api::FilesResource_UpdateMethod::mutable_addParents ( )
inline

Gets a modifiable pointer to the optional addParents' attribute.

Returns
The value can be set by dereferencing the pointer.

◆ mutable_modifiedDateBehavior()

string* google_drive_api::FilesResource_UpdateMethod::mutable_modifiedDateBehavior ( )
inline

Gets a modifiable pointer to the optional modifiedDateBehavior' attribute.

Returns
The value can be set by dereferencing the pointer.

◆ mutable_ocrLanguage()

string* google_drive_api::FilesResource_UpdateMethod::mutable_ocrLanguage ( )
inline

Gets a modifiable pointer to the optional ocrLanguage' attribute.

Returns
The value can be set by dereferencing the pointer.

◆ mutable_removeParents()

string* google_drive_api::FilesResource_UpdateMethod::mutable_removeParents ( )
inline

Gets a modifiable pointer to the optional removeParents' attribute.

Returns
The value can be set by dereferencing the pointer.

◆ mutable_timedTextLanguage()

string* google_drive_api::FilesResource_UpdateMethod::mutable_timedTextLanguage ( )
inline

Gets a modifiable pointer to the optional timedTextLanguage' attribute.

Returns
The value can be set by dereferencing the pointer.

◆ mutable_timedTextTrackName()

string* google_drive_api::FilesResource_UpdateMethod::mutable_timedTextTrackName ( )
inline

Gets a modifiable pointer to the optional timedTextTrackName' attribute.

Returns
The value can be set by dereferencing the pointer.

◆ set_add_parents()

void google_drive_api::FilesResource_UpdateMethod::set_add_parents ( const string &  value)
inline

Sets the 'addParents' attribute.

Parameters
[in]valueComma-separated list of parent IDs to add.

◆ set_convert()

void google_drive_api::FilesResource_UpdateMethod::set_convert ( bool  value)
inline

Sets the 'convert' attribute.

Parameters
[in]valueThis parameter is deprecated and has no function.

◆ set_enforce_single_parent()

void google_drive_api::FilesResource_UpdateMethod::set_enforce_single_parent ( bool  value)
inline

Sets the 'enforceSingleParent' attribute.

Parameters
[in]valueSet to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item will be removed from all current folders and placed in the requested folder. Other requests that increase the number of parents will fail, except when the canAddMyDriveParent file capability is true and a single parent is being added.

◆ set_modified_date_behavior()

void google_drive_api::FilesResource_UpdateMethod::set_modified_date_behavior ( const string &  value)
inline

Sets the 'modifiedDateBehavior' attribute.

Parameters
[in]valueDetermines the behavior in which modifiedDate is updated. This overrides setModifiedDate.

◆ set_new_revision()

void google_drive_api::FilesResource_UpdateMethod::set_new_revision ( bool  value)
inline

Sets the 'newRevision' attribute.

Parameters
[in]valueWhether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.

◆ set_ocr()

void google_drive_api::FilesResource_UpdateMethod::set_ocr ( bool  value)
inline

Sets the 'ocr' attribute.

Parameters
[in]valueWhether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.

◆ set_ocr_language()

void google_drive_api::FilesResource_UpdateMethod::set_ocr_language ( const string &  value)
inline

Sets the 'ocrLanguage' attribute.

Parameters
[in]valueIf ocr is true, hints at the language to use. Valid values are BCP 47 codes.

◆ set_pinned()

void google_drive_api::FilesResource_UpdateMethod::set_pinned ( bool  value)
inline

Sets the 'pinned' attribute.

Parameters
[in]valueWhether to pin the new revision. A file can have a maximum of 200 pinned revisions.

◆ set_remove_parents()

void google_drive_api::FilesResource_UpdateMethod::set_remove_parents ( const string &  value)
inline

Sets the 'removeParents' attribute.

Parameters
[in]valueComma-separated list of parent IDs to remove.

◆ set_set_modified_date()

void google_drive_api::FilesResource_UpdateMethod::set_set_modified_date ( bool  value)
inline

Sets the 'setModifiedDate' attribute.

Parameters
[in]valueWhether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange.

◆ set_supports_all_drives()

void google_drive_api::FilesResource_UpdateMethod::set_supports_all_drives ( bool  value)
inline

Sets the 'supportsAllDrives' attribute.

Deprecated:
Parameters
[in]valueDeprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.

◆ set_supports_team_drives()

void google_drive_api::FilesResource_UpdateMethod::set_supports_team_drives ( bool  value)
inline

Sets the 'supportsTeamDrives' attribute.

Deprecated:
Parameters
[in]valueDeprecated use supportsAllDrives instead.

◆ set_timed_text_language()

void google_drive_api::FilesResource_UpdateMethod::set_timed_text_language ( const string &  value)
inline

Sets the 'timedTextLanguage' attribute.

Parameters
[in]valueThe language of the timed text.

◆ set_timed_text_track_name()

void google_drive_api::FilesResource_UpdateMethod::set_timed_text_track_name ( const string &  value)
inline

Sets the 'timedTextTrackName' attribute.

Parameters
[in]valueThe timed text track name.

◆ set_update_viewed_date()

void google_drive_api::FilesResource_UpdateMethod::set_update_viewed_date ( bool  value)
inline

Sets the 'updateViewedDate' attribute.

Parameters
[in]valueWhether to update the view date after successfully updating the file.

◆ set_use_content_as_indexable_text()

void google_drive_api::FilesResource_UpdateMethod::set_use_content_as_indexable_text ( bool  value)
inline

Sets the 'useContentAsIndexableText' attribute.

Parameters
[in]valueWhether to use the content as indexable text.

Member Data Documentation

◆ RESUMABLE_MEDIA_UPLOAD

const client::MediaUploadSpec google_drive_api::FilesResource_UpdateMethod::RESUMABLE_MEDIA_UPLOAD
static

Returns the specification for media upload using the resumable protocol.

◆ SIMPLE_MEDIA_UPLOAD

const client::MediaUploadSpec google_drive_api::FilesResource_UpdateMethod::SIMPLE_MEDIA_UPLOAD
static

Returns MediaUploader for uploading the content. Returns the specification for media upload using the simple protocol.


The documentation for this class was generated from the following files: