Class: Google::Apis::DatastoreV1::MutationResult

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

Overview

The result of applying a mutation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ MutationResult

Returns a new instance of MutationResult.

[View source]

2004
2005
2006
# File 'lib/google/apis/datastore_v1/classes.rb', line 2004

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

Instance Attribute Details

#conflict_detectedBoolean Also known as: conflict_detected?

Whether a conflict was detected for this mutation. Always false when a conflict detection strategy field is not set in the mutation. Corresponds to the JSON property conflictDetected

Returns:

  • (Boolean)

1966
1967
1968
# File 'lib/google/apis/datastore_v1/classes.rb', line 1966

def conflict_detected
  @conflict_detected
end

#create_timeString

The create time of the entity. This field will not be set after a 'delete'. Corresponds to the JSON property createTime

Returns:

  • (String)

1972
1973
1974
# File 'lib/google/apis/datastore_v1/classes.rb', line 1972

def create_time
  @create_time
end

#keyGoogle::Apis::DatastoreV1::Key

A unique identifier for an entity. If a key's partition ID or any of its path kinds or names are reserved/read-only, the key is reserved/read-only. A reserved/read-only key is forbidden in certain documented contexts. Corresponds to the JSON property key


1979
1980
1981
# File 'lib/google/apis/datastore_v1/classes.rb', line 1979

def key
  @key
end

#transform_resultsArray<Google::Apis::DatastoreV1::Value>

The results of applying each PropertyTransform, in the same order of the request. Corresponds to the JSON property transformResults


1985
1986
1987
# File 'lib/google/apis/datastore_v1/classes.rb', line 1985

def transform_results
  @transform_results
end

#update_timeString

The update time of the entity on the server after processing the mutation. If the mutation doesn't change anything on the server, then the timestamp will be the update timestamp of the current entity. This field will not be set after a 'delete'. Corresponds to the JSON property updateTime

Returns:

  • (String)

1993
1994
1995
# File 'lib/google/apis/datastore_v1/classes.rb', line 1993

def update_time
  @update_time
end

#versionFixnum

The version of the entity on the server after processing the mutation. If the mutation doesn't change anything on the server, then the version will be the version of the current entity or, if no entity is present, a version that is strictly greater than the version of any previous entity and less than the version of any possible future entity. Corresponds to the JSON property version

Returns:

  • (Fixnum)

2002
2003
2004
# File 'lib/google/apis/datastore_v1/classes.rb', line 2002

def version
  @version
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

2009
2010
2011
2012
2013
2014
2015
2016
# File 'lib/google/apis/datastore_v1/classes.rb', line 2009

def update!(**args)
  @conflict_detected = args[:conflict_detected] if args.key?(:conflict_detected)
  @create_time = args[:create_time] if args.key?(:create_time)
  @key = args[:key] if args.key?(:key)
  @transform_results = args[:transform_results] if args.key?(:transform_results)
  @update_time = args[:update_time] if args.key?(:update_time)
  @version = args[:version] if args.key?(:version)
end