// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.10.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Google Cloud Datastore API Version v1beta1
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://developers.google.com/datastore/'>Google Cloud Datastore API</a>
 *      <tr><th>API Version<td>v1beta1
 *      <tr><th>API Rev<td>20151008 (280)
 *      <tr><th>API Docs
 *          <td><a href='https://developers.google.com/datastore/'>
 *              https://developers.google.com/datastore/</a>
 *      <tr><th>Discovery Name<td>datastore
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Google Cloud Datastore API can be found at
 * <a href='https://developers.google.com/datastore/'>https://developers.google.com/datastore/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Datastore.v1beta1
{
    /// <summary>The Datastore Service.</summary>
    public class DatastoreService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v1beta1";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public DatastoreService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public DatastoreService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            datasets = new DatasetsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "datastore"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/datastore/v1beta1/datasets/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "datastore/v1beta1/datasets/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Google Cloud Datastore API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

            /// <summary>View and manage your Google Cloud Datastore data</summary>
            public static string Datastore = "https://www.googleapis.com/auth/datastore";

            /// <summary>View your email address</summary>
            public static string UserinfoEmail = "https://www.googleapis.com/auth/userinfo.email";

        }



        private readonly DatasetsResource datasets;

        /// <summary>Gets the Datasets resource.</summary>
        public virtual DatasetsResource Datasets
        {
            get { return datasets; }
        }
    }

    ///<summary>A base abstract class for Datastore requests.</summary>
    public abstract class DatastoreBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new DatastoreBaseServiceRequest instance.</summary>
        protected DatastoreBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: proto]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
            /// <summary>Responses with Content-Type of application/x-protobuf</summary>
            [Google.Apis.Util.StringValueAttribute("proto")]
            Proto,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>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. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes Datastore parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "proto",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "datasets" collection of methods.</summary>
    public class DatasetsResource
    {
        private const string Resource = "datasets";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public DatasetsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Allocate IDs for incomplete keys (useful for referencing an entity before it is
        /// inserted).</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual AllocateIdsRequest AllocateIds(Google.Apis.Datastore.v1beta1.Data.AllocateIdsRequest body, string datasetId)
        {
            return new AllocateIdsRequest(service, body, datasetId);
        }

        /// <summary>Allocate IDs for incomplete keys (useful for referencing an entity before it is
        /// inserted).</summary>
        public class AllocateIdsRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.AllocateIdsResponse>
        {
            /// <summary>Constructs a new AllocateIds request.</summary>
            public AllocateIdsRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.AllocateIdsRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.AllocateIdsRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "allocateIds"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/allocateIds"; }
            }

            /// <summary>Initializes AllocateIds parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Begin a new transaction.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual BeginTransactionRequest BeginTransaction(Google.Apis.Datastore.v1beta1.Data.BeginTransactionRequest body, string datasetId)
        {
            return new BeginTransactionRequest(service, body, datasetId);
        }

        /// <summary>Begin a new transaction.</summary>
        public class BeginTransactionRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.BeginTransactionResponse>
        {
            /// <summary>Constructs a new BeginTransaction request.</summary>
            public BeginTransactionRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.BeginTransactionRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.BeginTransactionRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "beginTransaction"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/beginTransaction"; }
            }

            /// <summary>Initializes BeginTransaction parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Create, delete or modify some entities outside a transaction.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual BlindWriteRequest BlindWrite(Google.Apis.Datastore.v1beta1.Data.BlindWriteRequest body, string datasetId)
        {
            return new BlindWriteRequest(service, body, datasetId);
        }

        /// <summary>Create, delete or modify some entities outside a transaction.</summary>
        public class BlindWriteRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.BlindWriteResponse>
        {
            /// <summary>Constructs a new BlindWrite request.</summary>
            public BlindWriteRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.BlindWriteRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.BlindWriteRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "blindWrite"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/blindWrite"; }
            }

            /// <summary>Initializes BlindWrite parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Commit a transaction, optionally creating, deleting or modifying some entities.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual CommitRequest Commit(Google.Apis.Datastore.v1beta1.Data.CommitRequest body, string datasetId)
        {
            return new CommitRequest(service, body, datasetId);
        }

        /// <summary>Commit a transaction, optionally creating, deleting or modifying some entities.</summary>
        public class CommitRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.CommitResponse>
        {
            /// <summary>Constructs a new Commit request.</summary>
            public CommitRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.CommitRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.CommitRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "commit"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/commit"; }
            }

            /// <summary>Initializes Commit parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Look up some entities by key.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual LookupRequest Lookup(Google.Apis.Datastore.v1beta1.Data.LookupRequest body, string datasetId)
        {
            return new LookupRequest(service, body, datasetId);
        }

        /// <summary>Look up some entities by key.</summary>
        public class LookupRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.LookupResponse>
        {
            /// <summary>Constructs a new Lookup request.</summary>
            public LookupRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.LookupRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.LookupRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "lookup"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/lookup"; }
            }

            /// <summary>Initializes Lookup parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Roll back a transaction.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual RollbackRequest Rollback(Google.Apis.Datastore.v1beta1.Data.RollbackRequest body, string datasetId)
        {
            return new RollbackRequest(service, body, datasetId);
        }

        /// <summary>Roll back a transaction.</summary>
        public class RollbackRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.RollbackResponse>
        {
            /// <summary>Constructs a new Rollback request.</summary>
            public RollbackRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.RollbackRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.RollbackRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "rollback"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/rollback"; }
            }

            /// <summary>Initializes Rollback parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Query for entities.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="datasetId">Identifies the dataset.</param>
        public virtual RunQueryRequest RunQuery(Google.Apis.Datastore.v1beta1.Data.RunQueryRequest body, string datasetId)
        {
            return new RunQueryRequest(service, body, datasetId);
        }

        /// <summary>Query for entities.</summary>
        public class RunQueryRequest : DatastoreBaseServiceRequest<Google.Apis.Datastore.v1beta1.Data.RunQueryResponse>
        {
            /// <summary>Constructs a new RunQuery request.</summary>
            public RunQueryRequest(Google.Apis.Services.IClientService service, Google.Apis.Datastore.v1beta1.Data.RunQueryRequest body, string datasetId)
                : base(service)
            {
                DatasetId = datasetId;
                Body = body;
                InitParameters();
            }


            /// <summary>Identifies the dataset.</summary>
            [Google.Apis.Util.RequestParameterAttribute("datasetId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string DatasetId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Datastore.v1beta1.Data.RunQueryRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "runQuery"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "{datasetId}/runQuery"; }
            }

            /// <summary>Initializes RunQuery parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "datasetId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "datasetId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }
}

namespace Google.Apis.Datastore.v1beta1.Data
{    

    public class AllocateIdsRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A list of keys with incomplete key paths to allocate IDs for. No key may be reserved/read-
        /// only.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keys")]
        public virtual System.Collections.Generic.IList<Key> Keys { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class AllocateIdsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>The keys specified in the request (in the same order), each with its key path completed with a
        /// newly allocated ID.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keys")]
        public virtual System.Collections.Generic.IList<Key> Keys { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BeginTransactionRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The transaction isolation level. Either snapshot or serializable. The default isolation level is
        /// snapshot isolation, which means that another transaction may not concurrently modify the data that is
        /// modified by this transaction. Optionally, a transaction can request to be made serializable which means that
        /// another transaction cannot concurrently modify the data that is read or modified by this
        /// transaction.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("isolationLevel")]
        public virtual string IsolationLevel { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BeginTransactionResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>The transaction identifier (always present).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("transaction")]
        public virtual string Transaction { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BlindWriteRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The mutation to perform.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("mutation")]
        public virtual Mutation Mutation { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class BlindWriteResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>The result of performing the mutation (always present).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("mutationResult")]
        public virtual MutationResult MutationResult { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class CommitRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("ignoreReadOnly")]
        public virtual System.Nullable<bool> IgnoreReadOnly { get; set; } 

        /// <summary>The mutation to perform. Optional.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("mutation")]
        public virtual Mutation Mutation { get; set; } 

        /// <summary>The transaction identifier, returned by a call to beginTransaction. Must be set when mode is
        /// TRANSACTIONAL.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("transaction")]
        public virtual string Transaction { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class CommitResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>The result of performing the mutation (if any).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("mutationResult")]
        public virtual MutationResult MutationResult { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A filter that merges the multiple other filters using the given operation.</summary>
    public class CompositeFilter : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The list of filters to combine. Must contain at least one filter.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("filters")]
        public virtual System.Collections.Generic.IList<Filter> Filters { get; set; } 

        /// <summary>The operator for combining multiple filters. Only "and" is currently supported.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("operator")]
        public virtual string Operator__ { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An entity.</summary>
    public class Entity : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The entity's key.
        ///
        /// An entity must have a key, unless otherwise documented (for example, an entity in Value.entityValue may have
        /// no key). An entity's kind is its key's path's last element's kind, or null if it has no key.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("key")]
        public virtual Key Key { get; set; } 

        /// <summary>The entity's properties.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("properties")]
        public virtual System.Collections.Generic.IDictionary<string,Property> Properties { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The result of fetching an entity from the datastore.</summary>
    public class EntityResult : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The resulting entity.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("entity")]
        public virtual Entity Entity { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A holder for any type of filter. Exactly one field should be specified.</summary>
    public class Filter : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A composite filter.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("compositeFilter")]
        public virtual CompositeFilter CompositeFilter { get; set; } 

        /// <summary>A filter on a property.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("propertyFilter")]
        public virtual PropertyFilter PropertyFilter { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A GQL query.</summary>
    public class GqlQuery : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>When false, the query string must not contain a literal.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("allowLiteral")]
        public virtual System.Nullable<bool> AllowLiteral { get; set; } 

        /// <summary>A named argument must set field GqlQueryArg.name. No two named arguments may have the same name.
        /// For each non-reserved named binding site in the query string, there must be a named argument with that name,
        /// but not necessarily the inverse.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nameArgs")]
        public virtual System.Collections.Generic.IList<GqlQueryArg> NameArgs { get; set; } 

        /// <summary>Numbered binding site @1 references the first numbered argument, effectively using 1-based
        /// indexing, rather than the usual 0. A numbered argument must NOT set field GqlQueryArg.name. For each binding
        /// site numbered i in query_string, there must be an ith numbered argument. The inverse must also be
        /// true.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("numberArgs")]
        public virtual System.Collections.Generic.IList<GqlQueryArg> NumberArgs { get; set; } 

        /// <summary>The query string.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("queryString")]
        public virtual string QueryString { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A binding argument for a GQL query.</summary>
    public class GqlQueryArg : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("cursor")]
        public virtual string Cursor { get; set; } 

        /// <summary>Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match regex "__.*__". Must not be
        /// "".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("value")]
        public virtual Value Value { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A unique identifier for an entity.</summary>
    public class Key : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Entities are partitioned into subsets, currently identified by a dataset (usually implicitly
        /// specified by the project) and namespace ID. Queries are scoped to a single partition.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("partitionId")]
        public virtual PartitionId PartitionId { get; set; } 

        /// <summary>The entity path. An entity path consists of one or more elements composed of a kind and a string or
        /// numerical identifier, which identify entities. The first element identifies a root entity, the second
        /// element identifies a child of the root entity, the third element a child of the second entity, and so forth.
        /// The entities identified by all prefixes of the path are called the element's ancestors. An entity path is
        /// always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity
        /// identifier itself. The only exception is that in some documented cases, the identifier in the last path
        /// element (for the entity) itself may be omitted. A path can never be empty. The path can have at most 100
        /// elements.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("path")]
        public virtual System.Collections.Generic.IList<KeyPathElement> Path { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A (kind, ID/name) pair used to construct a key path.
    ///
    /// At most one of name or ID may be set. If either is set, the element is complete. If neither is set, the element
    /// is incomplete.</summary>
    public class KeyPathElement : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be
        /// supported in the future.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual System.Nullable<long> Id { get; set; } 

        /// <summary>The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not
        /// contain more than 500 characters. Cannot be "".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be
        /// more than 500 characters. Cannot be "".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A representation of a kind.</summary>
    public class KindExpression : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The name of the kind.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class LookupRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Keys of entities to look up from the datastore.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keys")]
        public virtual System.Collections.Generic.IList<Key> Keys { get; set; } 

        /// <summary>Options for this lookup request. Optional.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("readOptions")]
        public virtual ReadOptions ReadOptions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class LookupResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A list of keys that were not looked up due to resource constraints.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("deferred")]
        public virtual System.Collections.Generic.IList<Key> Deferred { get; set; } 

        /// <summary>Entities found.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("found")]
        public virtual System.Collections.Generic.IList<EntityResult> Found { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>Entities not found, with only the key populated.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("missing")]
        public virtual System.Collections.Generic.IList<EntityResult> Missing { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A set of changes to apply.</summary>
    public class Mutation : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Keys of entities to delete. Each key must have a complete key path and must not be reserved/read-
        /// only.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("delete")]
        public virtual System.Collections.Generic.IList<Key> Delete { get; set; } 

        /// <summary>Ignore a user specified read-only period. Optional.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("force")]
        public virtual System.Nullable<bool> Force { get; set; } 

        /// <summary>Entities to insert. Each inserted entity's key must have a complete path and must not be reserved
        /// /read-only.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("insert")]
        public virtual System.Collections.Generic.IList<Entity> Insert { get; set; } 

        /// <summary>Insert entities with a newly allocated ID. Each inserted entity's key must omit the final
        /// identifier in its path and must not be reserved/read-only.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("insertAutoId")]
        public virtual System.Collections.Generic.IList<Entity> InsertAutoId { get; set; } 

        /// <summary>Entities to update. Each updated entity's key must have a complete path and must not be reserved
        /// /read-only.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("update")]
        public virtual System.Collections.Generic.IList<Entity> Update { get; set; } 

        /// <summary>Entities to upsert. Each upserted entity's key must have a complete path and must not be reserved
        /// /read-only.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("upsert")]
        public virtual System.Collections.Generic.IList<Entity> Upsert { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class MutationResult : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Number of index writes.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("indexUpdates")]
        public virtual System.Nullable<int> IndexUpdates { get; set; } 

        /// <summary>Keys for insertAutoId entities. One per entity from the request, in the same order.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("insertAutoIdKeys")]
        public virtual System.Collections.Generic.IList<Key> InsertAutoIdKeys { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An identifier for a particular subset of entities.
    ///
    /// Entities are partitioned into various subsets, each used by different datasets and different namespaces within a
    /// dataset and so forth.</summary>
    public class PartitionId : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The dataset ID.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("datasetId")]
        public virtual string DatasetId { get; set; } 

        /// <summary>The namespace.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("namespace")]
        public virtual string Namespace__ { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An entity property.</summary>
    public class Property : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If this property contains a list of values. Input values may explicitly set multi to false, but
        /// otherwise false is always represented by omitting multi.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("multi")]
        public virtual System.Nullable<bool> Multi { get; set; } 

        /// <summary>The value(s) of the property. When multi is false there is always exactly one value. When multi is
        /// true there are always one or more values. Each value can have only one value property populated. For
        /// example, you cannot have a values list of { values: [ { integerValue: 22, stringValue: "a" } ] }, but you
        /// can have { multi: true, values: [ { integerValue: 22 }, { stringValue: "a" } ] }.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("values")]
        public virtual System.Collections.Generic.IList<Value> Values { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A representation of a property in a projection.</summary>
    public class PropertyExpression : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The aggregation function to apply to the property. Optional. Can only be used when grouping by at
        /// least one property. Must then be set on all properties in the projection that are not being grouped by.
        /// Aggregation functions: first selects the first result as determined by the query's order.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("aggregationFunction")]
        public virtual string AggregationFunction { get; set; } 

        /// <summary>The property to project.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("property")]
        public virtual PropertyReference Property { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A filter on a specific property.</summary>
    public class PropertyFilter : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The operator to filter by. One of lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual,
        /// equal, or hasAncestor.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("operator")]
        public virtual string Operator__ { get; set; } 

        /// <summary>The property to filter by.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("property")]
        public virtual PropertyReference Property { get; set; } 

        /// <summary>The value to compare the property to.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("value")]
        public virtual Value Value { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The desired order for a specific property.</summary>
    public class PropertyOrder : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The direction to order by. One of ascending or descending. Optional, defaults to
        /// ascending.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("direction")]
        public virtual string Direction { get; set; } 

        /// <summary>The property to order by.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("property")]
        public virtual PropertyReference Property { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A reference to a property relative to the kind expressions.</summary>
    public class PropertyReference : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The name of the property.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A query.</summary>
    public class Query : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>An ending point for the query results. Optional. Query cursors are returned in query result
        /// batches.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endCursor")]
        public virtual string EndCursor { get; set; } 

        /// <summary>The filter to apply (optional).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("filter")]
        public virtual Filter Filter { get; set; } 

        /// <summary>The properties to group by (if empty, no grouping is applied to the result set).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("groupBy")]
        public virtual System.Collections.Generic.IList<PropertyReference> GroupBy { get; set; } 

        /// <summary>The kinds to query (if empty, returns entities from all kinds).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kinds")]
        public virtual System.Collections.Generic.IList<KindExpression> Kinds { get; set; } 

        /// <summary>The maximum number of results to return. Applies after all other constraints. Optional.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("limit")]
        public virtual System.Nullable<int> Limit { get; set; } 

        /// <summary>The number of results to skip. Applies before limit, but after all other constraints (optional,
        /// defaults to 0).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("offset")]
        public virtual System.Nullable<int> Offset { get; set; } 

        /// <summary>The order to apply to the query results (if empty, order is unspecified).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("order")]
        public virtual System.Collections.Generic.IList<PropertyOrder> Order { get; set; } 

        /// <summary>The projection to return. If not set the entire entity is returned.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("projection")]
        public virtual System.Collections.Generic.IList<PropertyExpression> Projection { get; set; } 

        /// <summary>A starting point for the query results. Optional. Query cursors are returned in query result
        /// batches.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startCursor")]
        public virtual string StartCursor { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A batch of results produced by a query.</summary>
    public class QueryResultBatch : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A cursor that points to the position after the last result in the batch. May be absent.
        /// TODO(arfuller): Once all plans produce cursors update documentation here.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endCursor")]
        public virtual string EndCursor { get; set; } 

        /// <summary>The result type for every entity in entityResults. full for full entities, projection for entities
        /// with only projected properties, keyOnly for entities with only a key.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("entityResultType")]
        public virtual string EntityResultType { get; set; } 

        /// <summary>The results for this batch.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("entityResults")]
        public virtual System.Collections.Generic.IList<EntityResult> EntityResults { get; set; } 

        /// <summary>The state of the query after the current batch. One of notFinished, moreResultsAfterLimit,
        /// noMoreResults.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("moreResults")]
        public virtual string MoreResults { get; set; } 

        /// <summary>The number of results skipped because of Query.offset.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("skippedResults")]
        public virtual System.Nullable<int> SkippedResults { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ReadOptions : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The read consistency to use. One of default, strong, or eventual. Cannot be set when transaction is
        /// set. Lookup and ancestor queries default to strong, global queries default to eventual and cannot be set to
        /// strong. Optional. Default is default.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("readConsistency")]
        public virtual string ReadConsistency { get; set; } 

        /// <summary>The transaction to use. Optional.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("transaction")]
        public virtual string Transaction { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ResponseHeader : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Identifies what kind of resource this is. Value: the fixed string
        /// "datastore#responseHeader".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("kind")]
        public virtual string Kind { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class RollbackRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The transaction identifier, returned by a call to beginTransaction.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("transaction")]
        public virtual string Transaction { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class RollbackResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class RunQueryRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The GQL query to run. Either this field or field query must be set, but not both.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("gqlQuery")]
        public virtual GqlQuery GqlQuery { get; set; } 

        /// <summary>Entities are partitioned into subsets, identified by a dataset (usually implicitly specified by the
        /// project) and namespace ID. Queries are scoped to a single partition. This partition ID is normalized with
        /// the standard default context partition ID, but all other partition IDs in RunQueryRequest are normalized
        /// with this partition ID as the context partition ID.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("partitionId")]
        public virtual PartitionId PartitionId { get; set; } 

        /// <summary>The query to run. Either this field or field gql_query must be set, but not both.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("query")]
        public virtual Query Query { get; set; } 

        /// <summary>The options for this query.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("readOptions")]
        public virtual ReadOptions ReadOptions { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class RunQueryResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A batch of query results (always present).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("batch")]
        public virtual QueryResultBatch Batch { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("header")]
        public virtual ResponseHeader Header { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A message that can hold any of the supported value types and associated metadata.</summary>
    public class Value : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A blob key value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("blobKeyValue")]
        public virtual string BlobKeyValue { get; set; } 

        /// <summary>A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500
        /// bytes.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("blobValue")]
        public virtual string BlobValue { get; set; } 

        /// <summary>A boolean value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("booleanValue")]
        public virtual System.Nullable<bool> BooleanValue { get; set; } 

        /// <summary>A timestamp value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("dateTimeValue")]
        public virtual string DateTimeValueRaw { get; set; }

        /// <summary><seealso cref="System.DateTime"/> representation of <see cref="DateTimeValueRaw"/>.</summary>
        [Newtonsoft.Json.JsonIgnore]
        public virtual System.Nullable<System.DateTime> DateTimeValue
        {
            get
            {
                return Google.Apis.Util.Utilities.GetDateTimeFromString(DateTimeValueRaw);
            }
            set
            {
                DateTimeValueRaw = Google.Apis.Util.Utilities.GetStringFromDateTime(value);
            }
        }

        /// <summary>A double value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("doubleValue")]
        public virtual System.Nullable<double> DoubleValue { get; set; } 

        /// <summary>An entity value. May have no key. May have a key with an incomplete key path. May have a reserved
        /// /read-only key.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("entityValue")]
        public virtual Entity EntityValue { get; set; } 

        /// <summary>If the value should be indexed.
        ///
        /// The indexed property may be set for a null value. When indexed is true, stringValue is limited to 500
        /// characters and the blob value is limited to 500 bytes. Input values by default have indexed set to true;
        /// however, you can explicitly set indexed to true if you want. (An output value never has indexed explicitly
        /// set to true.) If a value is itself an entity, it cannot have indexed set to true.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("indexed")]
        public virtual System.Nullable<bool> Indexed { get; set; } 

        /// <summary>An integer value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("integerValue")]
        public virtual System.Nullable<long> IntegerValue { get; set; } 

        /// <summary>A key value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("keyValue")]
        public virtual Key KeyValue { get; set; } 

        /// <summary>The meaning field is reserved and should not be used.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("meaning")]
        public virtual System.Nullable<int> Meaning { get; set; } 

        /// <summary>A UTF-8 encoded string value. When indexed is true, may have at most 500 characters.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("stringValue")]
        public virtual string StringValue { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
