diff --git a/api_names_out.yaml b/api_names_out.yaml index 10c8954b8..0e89b3d40 100644 --- a/api_names_out.yaml +++ b/api_names_out.yaml @@ -103153,6 +103153,10 @@ "/games:v1/QuestMilestone/id": id "/games:v1/QuestMilestone/kind": kind "/games:v1/QuestMilestone/state": state +"/games:v1/ResolveSnapshotHeadRequest": resolve_snapshot_head_request +"/games:v1/ResolveSnapshotHeadRequest/resolutionPolicy": resolution_policy +"/games:v1/ResolveSnapshotHeadResponse": resolve_snapshot_head_response +"/games:v1/ResolveSnapshotHeadResponse/snapshot": snapshot "/games:v1/RevisionCheckResponse": check_revision_response "/games:v1/RevisionCheckResponse/apiVersion": api_version "/games:v1/RevisionCheckResponse/kind": kind @@ -103273,6 +103277,24 @@ "/games:v1/Snapshot/title": title "/games:v1/Snapshot/type": type "/games:v1/Snapshot/uniqueName": unique_name +"/games:v1/SnapshotCoverImageResource": snapshot_cover_image_resource +"/games:v1/SnapshotCoverImageResource/contentHash": content_hash +"/games:v1/SnapshotCoverImageResource/downloadUrl": download_url +"/games:v1/SnapshotCoverImageResource/height": height +"/games:v1/SnapshotCoverImageResource/mimeType": mime_type +"/games:v1/SnapshotCoverImageResource/resourceId": resource_id +"/games:v1/SnapshotCoverImageResource/width": width +"/games:v1/SnapshotDataResource": snapshot_data_resource +"/games:v1/SnapshotDataResource/contentHash": content_hash +"/games:v1/SnapshotDataResource/downloadUrl": download_url +"/games:v1/SnapshotDataResource/resourceId": resource_id +"/games:v1/SnapshotDataResource/size": size +"/games:v1/SnapshotExtended": snapshot_extended +"/games:v1/SnapshotExtended/conflictingRevisions": conflicting_revisions +"/games:v1/SnapshotExtended/conflictingRevisions/conflicting_revision": conflicting_revision +"/games:v1/SnapshotExtended/hasConflictingRevisions": has_conflicting_revisions +"/games:v1/SnapshotExtended/headRevision": head_revision +"/games:v1/SnapshotExtended/name": name "/games:v1/SnapshotImage": snapshot_image "/games:v1/SnapshotImage/height": height "/games:v1/SnapshotImage/kind": kind @@ -103284,6 +103306,18 @@ "/games:v1/SnapshotListResponse/items/item": item "/games:v1/SnapshotListResponse/kind": kind "/games:v1/SnapshotListResponse/nextPageToken": next_page_token +"/games:v1/SnapshotMetadata": snapshot_metadata +"/games:v1/SnapshotMetadata/description": description +"/games:v1/SnapshotMetadata/deviceName": device_name +"/games:v1/SnapshotMetadata/duration": duration +"/games:v1/SnapshotMetadata/lastModifyTime": last_modify_time +"/games:v1/SnapshotMetadata/progressValue": progress_value +"/games:v1/SnapshotMetadata/title": title +"/games:v1/SnapshotRevision": snapshot_revision +"/games:v1/SnapshotRevision/blob": blob +"/games:v1/SnapshotRevision/coverImage": cover_image +"/games:v1/SnapshotRevision/id": id +"/games:v1/SnapshotRevision/metadata": metadata "/games:v1/StatsResponse": stats_response "/games:v1/StatsResponse/avg_session_length_minutes": avg_session_length_minutes "/games:v1/StatsResponse/churn_probability": churn_probability @@ -103560,6 +103594,8 @@ "/games:v1/games.snapshots.list/maxResults": max_results "/games:v1/games.snapshots.list/pageToken": page_token "/games:v1/games.snapshots.list/playerId": player_id +"/games:v1/games.snapshotsExtended.resolveSnapshotHead": resolve_snapshots_extended_snapshot_head +"/games:v1/games.snapshotsExtended.resolveSnapshotHead/snapshotName": snapshot_name "/games:v1/games.stats.get": get_stat "/games:v1/games.turnBasedMatches.cancel": cancel_turn_based_match "/games:v1/games.turnBasedMatches.cancel/consistencyToken": consistency_token diff --git a/generated/google/apis/games_v1.rb b/generated/google/apis/games_v1.rb index 4b910c88b..985915e71 100644 --- a/generated/google/apis/games_v1.rb +++ b/generated/google/apis/games_v1.rb @@ -26,7 +26,7 @@ module Google # @see https://developers.google.com/games/ module GamesV1 VERSION = 'V1' - REVISION = '20201016' + REVISION = '20201022' # View and manage its own configuration data in your Google Drive AUTH_DRIVE_APPDATA = 'https://www.googleapis.com/auth/drive.appdata' diff --git a/generated/google/apis/games_v1/classes.rb b/generated/google/apis/games_v1/classes.rb index c2b0952e7..5a4092787 100644 --- a/generated/google/apis/games_v1/classes.rb +++ b/generated/google/apis/games_v1/classes.rb @@ -2287,6 +2287,53 @@ module Google end end + # Request for ResolveSnapshotHead RPC. + class ResolveSnapshotHeadRequest + include Google::Apis::Core::Hashable + + # Required. The automatic resolution policy. All conflicts are resolved in + # chronological order, starting from the/ least recent. If the comparison metric + # is equal for the tentative head and the conflict, the head wins. + # Corresponds to the JSON property `resolutionPolicy` + # @return [String] + attr_accessor :resolution_policy + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @resolution_policy = args[:resolution_policy] if args.key?(:resolution_policy) + end + end + + # Response for ResolveSnapshotHead RPC. + class ResolveSnapshotHeadResponse + include Google::Apis::Core::Hashable + + # A snapshot represents a saved game state referred to using the developer- + # provided snapshot_id (think of it as a file's path). The set of attributes and + # binary data for a specific state is called a revision. Each revision is itself + # immutable, and referred to by a snapshot_revision_id. At any time, a snapshot + # has a "head" revision, and updates are made against that revision. If a + # snapshot update is received that isn't against the current head revision, then + # instead of changing the head revision it will result in a conflicting revision + # that must be specifically resolved. + # Corresponds to the JSON property `snapshot` + # @return [Google::Apis::GamesV1::SnapshotExtended] + attr_accessor :snapshot + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @snapshot = args[:snapshot] if args.key?(:snapshot) + end + end + # A third party checking a revision response. class CheckRevisionResponse include Google::Apis::Core::Hashable @@ -2449,6 +2496,168 @@ module Google end end + # Identifies a snapshot cover image resource. The image is provided by the game. + class SnapshotCoverImageResource + include Google::Apis::Core::Hashable + + # Output only. Hash-like weak identifier of the uploaded image bytes, consistent + # per player per application. Within the context of a single player/application, + # it's guaranteed that two identical blobs coming from two different uploads + # will have the same content hash. It's extremely likely, though not guaranteed, + # that if two content hashes are equal, the images are identical. + # Corresponds to the JSON property `contentHash` + # @return [String] + attr_accessor :content_hash + + # Output only. A URL the client can use to download the image. May vary across + # requests, and only guaranteed to be valid for a short time after it is + # returned. + # Corresponds to the JSON property `downloadUrl` + # @return [String] + attr_accessor :download_url + + # Output only. The height of the image in pixels. + # Corresponds to the JSON property `height` + # @return [Fixnum] + attr_accessor :height + + # Output only. The MIME type of the image. + # Corresponds to the JSON property `mimeType` + # @return [String] + attr_accessor :mime_type + + # The ID of the image resource. It's guaranteed that if two IDs are equal then + # the contents are equal as well. It's not guaranteed that two identical blobs + # coming from separate uploads have the same ID. The resource ID can only be + # used within the application, user and resource type it was originally returned + # for. For example, it's not possible to use SnapshotDataResource's resource ID + # as the resource_id of a SnapshotCoverImageResource, even if the blob is a + # valid image file. + # Corresponds to the JSON property `resourceId` + # @return [String] + attr_accessor :resource_id + + # Output only. The width of the image in pixels. + # Corresponds to the JSON property `width` + # @return [Fixnum] + attr_accessor :width + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @content_hash = args[:content_hash] if args.key?(:content_hash) + @download_url = args[:download_url] if args.key?(:download_url) + @height = args[:height] if args.key?(:height) + @mime_type = args[:mime_type] if args.key?(:mime_type) + @resource_id = args[:resource_id] if args.key?(:resource_id) + @width = args[:width] if args.key?(:width) + end + end + + # Identifies a snapshot data resource. The data is provided by the game. + class SnapshotDataResource + include Google::Apis::Core::Hashable + + # Output only. Hash-like weak identifier of the uploaded blob, consistent per + # player per application. Within the context of a single player/application, it' + # s guaranteed that two identical blobs coming from two different uploads will + # have the same content hash. It's extremely likely, though not guaranteed, that + # if two content hashes are equal, the blobs are identical. + # Corresponds to the JSON property `contentHash` + # @return [String] + attr_accessor :content_hash + + # Output only. A URL that the client can use to download the blob. May vary + # across requests, and only guaranteed to be valid for a short time after it is + # returned. + # Corresponds to the JSON property `downloadUrl` + # @return [String] + attr_accessor :download_url + + # The ID of the blob resource. It's guaranteed that if two IDs are equal then + # the contents are equal as well. It's not guaranteed that two identical blobs + # coming from separate uploads have the same resource ID. The resource ID can + # only be used within the application, user and resource type it was originally + # returned for. For example, it's not possible to use SnapshotDataResource's + # resource ID as the resource_id of a SnapshotCoverImageResource, even if the + # blob is a valid image file. + # Corresponds to the JSON property `resourceId` + # @return [String] + attr_accessor :resource_id + + # Size of the saved game blob in bytes. + # Corresponds to the JSON property `size` + # @return [Fixnum] + attr_accessor :size + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @content_hash = args[:content_hash] if args.key?(:content_hash) + @download_url = args[:download_url] if args.key?(:download_url) + @resource_id = args[:resource_id] if args.key?(:resource_id) + @size = args[:size] if args.key?(:size) + end + end + + # A snapshot represents a saved game state referred to using the developer- + # provided snapshot_id (think of it as a file's path). The set of attributes and + # binary data for a specific state is called a revision. Each revision is itself + # immutable, and referred to by a snapshot_revision_id. At any time, a snapshot + # has a "head" revision, and updates are made against that revision. If a + # snapshot update is received that isn't against the current head revision, then + # instead of changing the head revision it will result in a conflicting revision + # that must be specifically resolved. + class SnapshotExtended + include Google::Apis::Core::Hashable + + # A list of conflicting revisions. Only set if explicitly requested (e.g. using + # a field mask or a request flag), or if the RPC guarantees that this field is + # set. The conflicting revisions are sorted chronologically by their server + # creation time (oldest first). If there are too many conflicting revisions to + # return all of them in a single request this will only contain the first batch. + # In such case, the presented conflicting revisions must be resolved first in + # order to fetch the next batch. + # Corresponds to the JSON property `conflictingRevisions` + # @return [Array] + attr_accessor :conflicting_revisions + + # An indicator whether the snapshot has any conflicting revisions or not. Always + # set. + # Corresponds to the JSON property `hasConflictingRevisions` + # @return [Boolean] + attr_accessor :has_conflicting_revisions + alias_method :has_conflicting_revisions?, :has_conflicting_revisions + + # A Snapshot revision resource. Snapshot revisions are immutable. + # Corresponds to the JSON property `headRevision` + # @return [Google::Apis::GamesV1::SnapshotRevision] + attr_accessor :head_revision + + # An identifier of the snapshot,developer-specified. + # Corresponds to the JSON property `name` + # @return [String] + attr_accessor :name + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @conflicting_revisions = args[:conflicting_revisions] if args.key?(:conflicting_revisions) + @has_conflicting_revisions = args[:has_conflicting_revisions] if args.key?(:has_conflicting_revisions) + @head_revision = args[:head_revision] if args.key?(:head_revision) + @name = args[:name] if args.key?(:name) + end + end + # An image of a snapshot. class SnapshotImage include Google::Apis::Core::Hashable @@ -2527,6 +2736,97 @@ module Google end end + # Metadata about a snapshot revision. Snapshot metadata is immutable - a + # metadata change corresponds to a new snapshot revision. + class SnapshotMetadata + include Google::Apis::Core::Hashable + + # The description of this snapshot. + # Corresponds to the JSON property `description` + # @return [String] + attr_accessor :description + + # The device that created the current revision. + # Corresponds to the JSON property `deviceName` + # @return [String] + attr_accessor :device_name + + # The duration associated with this snapshot. Values with sub-millisecond + # precision can be rounded or trimmed to the closest millisecond. + # Corresponds to the JSON property `duration` + # @return [String] + attr_accessor :duration + + # The timestamp of the last modification to this snapshot. Values with sub- + # millisecond precision can be rounded or trimmed to the closest millisecond. + # Corresponds to the JSON property `lastModifyTime` + # @return [String] + attr_accessor :last_modify_time + + # The progress value (64-bit integer set by developer) associated with this + # snapshot. + # Corresponds to the JSON property `progressValue` + # @return [Fixnum] + attr_accessor :progress_value + + # The title of this snapshot. + # Corresponds to the JSON property `title` + # @return [String] + attr_accessor :title + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @description = args[:description] if args.key?(:description) + @device_name = args[:device_name] if args.key?(:device_name) + @duration = args[:duration] if args.key?(:duration) + @last_modify_time = args[:last_modify_time] if args.key?(:last_modify_time) + @progress_value = args[:progress_value] if args.key?(:progress_value) + @title = args[:title] if args.key?(:title) + end + end + + # A Snapshot revision resource. Snapshot revisions are immutable. + class SnapshotRevision + include Google::Apis::Core::Hashable + + # Identifies a snapshot data resource. The data is provided by the game. + # Corresponds to the JSON property `blob` + # @return [Google::Apis::GamesV1::SnapshotDataResource] + attr_accessor :blob + + # Identifies a snapshot cover image resource. The image is provided by the game. + # Corresponds to the JSON property `coverImage` + # @return [Google::Apis::GamesV1::SnapshotCoverImageResource] + attr_accessor :cover_image + + # Output only. A server generated identifier of the snapshot revision. + # Corresponds to the JSON property `id` + # @return [String] + attr_accessor :id + + # Metadata about a snapshot revision. Snapshot metadata is immutable - a + # metadata change corresponds to a new snapshot revision. + # Corresponds to the JSON property `metadata` + # @return [Google::Apis::GamesV1::SnapshotMetadata] + attr_accessor :metadata + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @blob = args[:blob] if args.key?(:blob) + @cover_image = args[:cover_image] if args.key?(:cover_image) + @id = args[:id] if args.key?(:id) + @metadata = args[:metadata] if args.key?(:metadata) + end + end + # A third party stats resource. class StatsResponse include Google::Apis::Core::Hashable diff --git a/generated/google/apis/games_v1/representations.rb b/generated/google/apis/games_v1/representations.rb index d5b5cf1c2..daaf22de5 100644 --- a/generated/google/apis/games_v1/representations.rb +++ b/generated/google/apis/games_v1/representations.rb @@ -346,6 +346,18 @@ module Google include Google::Apis::Core::JsonObjectSupport end + class ResolveSnapshotHeadRequest + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class ResolveSnapshotHeadResponse + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class CheckRevisionResponse class Representation < Google::Apis::Core::JsonRepresentation; end @@ -364,6 +376,24 @@ module Google include Google::Apis::Core::JsonObjectSupport end + class SnapshotCoverImageResource + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class SnapshotDataResource + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class SnapshotExtended + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class SnapshotImage class Representation < Google::Apis::Core::JsonRepresentation; end @@ -376,6 +406,18 @@ module Google include Google::Apis::Core::JsonObjectSupport end + class SnapshotMetadata + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class SnapshotRevision + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class StatsResponse class Representation < Google::Apis::Core::JsonRepresentation; end @@ -991,6 +1033,21 @@ module Google end end + class ResolveSnapshotHeadRequest + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :resolution_policy, as: 'resolutionPolicy' + end + end + + class ResolveSnapshotHeadResponse + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :snapshot, as: 'snapshot', class: Google::Apis::GamesV1::SnapshotExtended, decorator: Google::Apis::GamesV1::SnapshotExtended::Representation + + end + end + class CheckRevisionResponse # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -1029,6 +1086,40 @@ module Google end end + class SnapshotCoverImageResource + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :content_hash, as: 'contentHash' + property :download_url, as: 'downloadUrl' + property :height, as: 'height' + property :mime_type, as: 'mimeType' + property :resource_id, as: 'resourceId' + property :width, as: 'width' + end + end + + class SnapshotDataResource + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :content_hash, as: 'contentHash' + property :download_url, as: 'downloadUrl' + property :resource_id, as: 'resourceId' + property :size, :numeric_string => true, as: 'size' + end + end + + class SnapshotExtended + # @private + class Representation < Google::Apis::Core::JsonRepresentation + collection :conflicting_revisions, as: 'conflictingRevisions', class: Google::Apis::GamesV1::SnapshotRevision, decorator: Google::Apis::GamesV1::SnapshotRevision::Representation + + property :has_conflicting_revisions, as: 'hasConflictingRevisions' + property :head_revision, as: 'headRevision', class: Google::Apis::GamesV1::SnapshotRevision, decorator: Google::Apis::GamesV1::SnapshotRevision::Representation + + property :name, as: 'name' + end + end + class SnapshotImage # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -1050,6 +1141,31 @@ module Google end end + class SnapshotMetadata + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :description, as: 'description' + property :device_name, as: 'deviceName' + property :duration, as: 'duration' + property :last_modify_time, as: 'lastModifyTime' + property :progress_value, :numeric_string => true, as: 'progressValue' + property :title, as: 'title' + end + end + + class SnapshotRevision + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :blob, as: 'blob', class: Google::Apis::GamesV1::SnapshotDataResource, decorator: Google::Apis::GamesV1::SnapshotDataResource::Representation + + property :cover_image, as: 'coverImage', class: Google::Apis::GamesV1::SnapshotCoverImageResource, decorator: Google::Apis::GamesV1::SnapshotCoverImageResource::Representation + + property :id, as: 'id' + property :metadata, as: 'metadata', class: Google::Apis::GamesV1::SnapshotMetadata, decorator: Google::Apis::GamesV1::SnapshotMetadata::Representation + + end + end + class StatsResponse # @private class Representation < Google::Apis::Core::JsonRepresentation diff --git a/generated/google/apis/games_v1/service.rb b/generated/google/apis/games_v1/service.rb index 202346b34..dcf67c434 100644 --- a/generated/google/apis/games_v1/service.rb +++ b/generated/google/apis/games_v1/service.rb @@ -1072,6 +1072,40 @@ module Google execute_or_queue_command(command, &block) end + # Resolves any potential conflicts according to the resolution policy specified + # in the request and returns the snapshot head after the resolution. + # @param [String] snapshot_name + # Required. Name of the snapshot. + # @param [Google::Apis::GamesV1::ResolveSnapshotHeadRequest] resolve_snapshot_head_request_object + # @param [String] fields + # Selector specifying which fields to include in a partial response. + # @param [String] quota_user + # Available to use for quota purposes for server-side applications. Can be any + # arbitrary string assigned to a user, but should not exceed 40 characters. + # @param [Google::Apis::RequestOptions] options + # Request-specific options + # + # @yield [result, err] Result & error if block supplied + # @yieldparam result [Google::Apis::GamesV1::ResolveSnapshotHeadResponse] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::GamesV1::ResolveSnapshotHeadResponse] + # + # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried + # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification + # @raise [Google::Apis::AuthorizationError] Authorization is required + def resolve_snapshots_extended_snapshot_head(snapshot_name, resolve_snapshot_head_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'games/v1/snapshotsExtended/{snapshotName}:resolveHead', options) + command.request_representation = Google::Apis::GamesV1::ResolveSnapshotHeadRequest::Representation + command.request_object = resolve_snapshot_head_request_object + command.response_representation = Google::Apis::GamesV1::ResolveSnapshotHeadResponse::Representation + command.response_class = Google::Apis::GamesV1::ResolveSnapshotHeadResponse + command.params['snapshotName'] = snapshot_name unless snapshot_name.nil? + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + # Returns engagement and spend statistics in this application for the currently # authenticated user. # @param [String] fields diff --git a/generated/google/apis/games_v1/synth.metadata b/generated/google/apis/games_v1/synth.metadata index 8ba18e27d..fb5a74b21 100644 --- a/generated/google/apis/games_v1/synth.metadata +++ b/generated/google/apis/games_v1/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/google-api-ruby-client.git", - "sha": "cb0c5bf94e2b1c915107eec83041d4409c900155" + "sha": "9840c481849200572321532ecc3b128bebbc1583" } } ]