Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datastore: Transaction, NULL and fix ancestor #65

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 7 additions & 6 deletions google-cloud/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,31 @@ maintenance = { status = "actively-developed" }
# Derive macros
google-cloud-derive = { version = "0.2.1", path = "../google-cloud-derive", optional = true }

tonic = { version = "0.4.1", features = ["tls", "prost"] }
tonic = { version = "0.8.2", features = ["tls", "prost"] }
tokio = { version = "1.4.0", features = ["macros", "fs"] }
reqwest = { version = "0.11.2", optional = true, default_features = false, features = ["blocking", "json", "rustls-tls"] }
hyper = "0.14.4"
hyper-rustls = "0.22.1"
hyper-rustls = "0.23.0"
futures = "0.3.13"

prost = "0.7.0"
prost-types = "0.7.0"
prost = "0.11.0"
prost-types = "0.11.1"

http = "0.2.3"
chrono = "0.4.19"

serde = { version = "1.0.125", features = ["derive"] }
json = { package = "serde_json", version = "1.0.64" }
jwt = { package = "jsonwebtoken", version = "7.2.0" }
jwt = { package = "jsonwebtoken", version = "8.1.1" }
serde_yaml = "0.9.14"

thiserror = "1.0.24"

bytes = { version = "1.0.1", optional = true }
percent-encoding = { version = "2.1.0", optional = true }

[build-dependencies]
tonic-build = "0.4.1"
tonic-build = "0.8.2"

[features]
default = []
Expand Down
14 changes: 7 additions & 7 deletions google-cloud/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ use std::fs;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let protos = [
(["protos/google/pubsub/v1/pubsub.proto"], "src/pubsub/api"),
// (["protos/google/pubsub/v1/pubsub.proto"], "src/pubsub/api"),
(
["protos/google/datastore/v1/datastore.proto"],
"src/datastore/api",
),
(
["protos/google/cloud/vision/v1/image_annotator.proto"],
"src/vision/api",
),
// (
// ["protos/google/cloud/vision/v1/image_annotator.proto"],
// "src/vision/api",
// ),
];

for (proto_files, out_dir) in protos.iter() {
fs::create_dir_all(&out_dir)?;

tonic_build::configure()
.build_client(true)
// .build_client(true)
.build_server(false)
.format(true)
// .format(true)
.out_dir(&out_dir)
.compile(proto_files, &["protos"])?;

Expand Down
105 changes: 105 additions & 0 deletions google-cloud/protos/google/actions/sdk/v2/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel

# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")

proto_library(
name = "sdk_proto",
srcs = [
"account_linking.proto",
"account_linking_secret.proto",
"action.proto",
"actions_sdk.proto",
"actions_testing.proto",
"config_file.proto",
"data_file.proto",
"event_logs.proto",
"files.proto",
"localized_settings.proto",
"manifest.proto",
"release_channel.proto",
"settings.proto",
"surface.proto",
"theme_customization.proto",
"validation_results.proto",
"version.proto",
"webhook.proto",
],
deps = [
"//google/actions/sdk/v2/conversation:conversation_proto",
"//google/actions/sdk/v2/conversation/prompt:prompt_proto",
"//google/actions/sdk/v2/conversation/prompt/content:content_proto",
"//google/actions/sdk/v2/interactionmodel:interactionmodel_proto",
"//google/actions/sdk/v2/interactionmodel/prompt:prompt_proto",
"//google/actions/sdk/v2/interactionmodel/prompt/content:content_proto",
"//google/actions/sdk/v2/interactionmodel/type:type_proto",
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/rpc:status_proto",
"//google/type:latlng_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
],
)

proto_library_with_info(
name = "sdk_proto_with_info",
deps = [
":sdk_proto",
"//google/cloud:common_resources_proto",
],
)

##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)

nodejs_gapic_library(
name = "sdk_nodejs_gapic",
package_name = "@assistant/actions",
src = ":sdk_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "actions_grpc_service_config.json",
package = "google.actions.sdk.v2",
service_yaml = "actions_v2.yaml",
deps = [],
)

nodejs_gapic_assembly_pkg(
name = "actions-v2-nodejs",
deps = [
":sdk_nodejs_gapic",
":sdk_proto",
"//google/actions/sdk/v2/conversation:conversation_proto",
"//google/actions/sdk/v2/conversation/prompt:prompt_proto",
"//google/actions/sdk/v2/conversation/prompt/content:content_proto",
"//google/actions/sdk/v2/interactionmodel:interactionmodel_proto",
"//google/actions/sdk/v2/interactionmodel/prompt:prompt_proto",
"//google/actions/sdk/v2/interactionmodel/prompt/content:content_proto",
"//google/actions/sdk/v2/interactionmodel/type:type_proto",
],
)
126 changes: 126 additions & 0 deletions google-cloud/protos/google/actions/sdk/v2/account_linking.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Copyright 2020 Google LLC
//
// 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.

syntax = "proto3";

package google.actions.sdk.v2;

import "google/api/field_behavior.proto";

option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2;sdk";
option java_multiple_files = true;
option java_outer_classname = "AccountLinkingProto";
option java_package = "com.google.actions.sdk.v2";

// AccountLinking allows Google to guide the user to sign-in to the App's web
// services.
//
// For Google Sign In and OAuth + Google Sign In linking types, Google generates
// a client ID identifying your App to Google ("Client ID issued by Google to
// your Actions" on Console UI). This field is read-only and can be checked by
// navigating to the Console UI's Account Linking page.
// See: https://developers.google.com/assistant/identity/google-sign-in
//
// Note: For all account linking setting types (except for Google Sign In), you
// must provide a username and password for a test account in
// Settings.testing_instructions for the review team to review the app (they
// will not be visible to users).
message AccountLinking {
// The type of Account Linking to perform.
enum LinkingType {
// Unspecified.
LINKING_TYPE_UNSPECIFIED = 0;

// Google Sign In linking type.
// If using this linking type, no OAuth-related fields need to be set below.
GOOGLE_SIGN_IN = 1;

// OAuth and Google Sign In linking type.
OAUTH_AND_GOOGLE_SIGN_IN = 2;

// OAuth linking type.
OAUTH = 3;
}

// The OAuth2 grant type Google uses to guide the user to sign in to your
// App's web service.
enum AuthGrantType {
// Unspecified.
AUTH_GRANT_TYPE_UNSPECIFIED = 0;

// Authorization code grant. Requires you to provide both
// authentication URL and access token URL.
AUTH_CODE = 1;

// Implicit code grant. Only requires you to provide authentication
// URL.
IMPLICIT = 2;
}

// Required. If `true`, users are allowed to sign up for new accounts via voice.
// If `false`, account creation is only allowed on your website. Select this
// option if you want to display your terms of service or obtain user consents
// during sign-up.
// linking_type cannot be GOOGLE_SIGN_IN when this is `false`.
// linking_type cannot be OAUTH when this is `true`.
bool enable_account_creation = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The linking type to use.
// See https://developers.google.com/assistant/identity for further details on
// the linking types.
LinkingType linking_type = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. Indicates the type of authentication for OAUTH linking_type.
AuthGrantType auth_grant_type = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Client ID issued by your App to Google.
// This is the OAuth2 Client ID identifying Google to your service.
// Only set when using OAuth.
string app_client_id = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Endpoint for your sign-in web page that supports OAuth2 code or
// implicit flows.
// URL must use HTTPS.
// Only set when using OAuth.
string authorization_url = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. OAuth2 endpoint for token exchange.
// URL must use HTTPS.
// This is not set when only using OAuth with IMPLICIT grant as the
// linking type.
// Only set when using OAuth.
string token_url = 6 [(google.api.field_behavior) = OPTIONAL];

// Optional. List of permissions the user must consent to in order to use
// your service.
// Only set when using OAuth.
// Make sure to provide a Terms of Service in the directory information in
// LocalizedSettings.terms_of_service_url section if specifying this field.
repeated string scopes = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. This is the web page on your service which describes the
// permissions the user is granting to Google.
// Only set if using OAuth and Google Sign In.
// Make sure to provide a Terms of Service in the directory information in
// LocalizedSettings.terms_of_service_url section if specifying this field.
string learn_more_url = 8 [(google.api.field_behavior) = OPTIONAL];

// Optional. If true, allow Google to transmit client ID and secret via HTTP
// basic auth header. Otherwise, Google uses the client ID and secret inside
// the post body.
// Only set when using OAuth.
// Make sure to provide a Terms of Service in the directory information in
// LocalizedSettings.terms_of_service_url section if specifying this field.
bool use_basic_auth_header = 9 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2020 Google LLC
//
// 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.

syntax = "proto3";

package google.actions.sdk.v2;

option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2;sdk";
option java_multiple_files = true;
option java_outer_classname = "AccountLinkingSecretProto";
option java_package = "com.google.actions.sdk.v2";

// Information about the encrypted OAuth client secret used in account linking
// flows (for AUTH_CODE grant type).
message AccountLinkingSecret {
// Encrypted account linking client secret ciphertext.
bytes encrypted_client_secret = 1;

// The version of the crypto key used to encrypt the account linking client
// secret.
// Note that this field is ignored in push, preview, and version creation
// flows.
string encryption_key_version = 2;
}
Loading