Skip to content

Commit

Permalink
feat: Add ListSampleProjects endpoint, Canvas response fullscreen, Me…
Browse files Browse the repository at this point in the history
…dia response repeat, and entity set.

PiperOrigin-RevId: 374447959
  • Loading branch information
Google APIs authored and Copybara-Service committed May 18, 2021
1 parent 131ae3e commit 0f9e69b
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 10 deletions.
48 changes: 48 additions & 0 deletions google/actions/sdk/v2/actions_sdk.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ service ActionsSdk {
};
}

// Lists all the sample projects supported by the gactions CLI.
rpc ListSampleProjects(ListSampleProjectsRequest) returns (ListSampleProjectsResponse) {
option (google.api.http) = {
get: "/v2/sampleProjects"
};
}

// Lists all release channels and corresponding versions, if any.
rpc ListReleaseChannels(ListReleaseChannelsRequest) returns (ListReleaseChannelsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -321,6 +328,47 @@ message DecryptSecretResponse {
string client_secret = 1;
}

// RPC request for ListSampleProjects.
message ListSampleProjectsRequest {
// Optional. The maximum number of sample projects to return. The service may return
// fewer than this value.
// If unspecified, at most 1000 sample projects will be returned. Values above
// 1000 will be coerced to 1000.
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. A page token, received from a previous 'ListSampleProjects' call.
// Provide this to retrieve the subsequent page.
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
}

// RPC response for ListSampleProjects.
message ListSampleProjectsResponse {
// The list of sample projects supported.
repeated SampleProject sample_projects = 1;

// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}

// Definition of sample project resource.
message SampleProject {
option (google.api.resource) = {
type: "actions.googleapis.com/SampleProject"
pattern: "sampleProjects/{sample_project}"
};

// The name of the sample project.
// Format: `sampleProjects/{sample_project}`
string name = 1;

// The URL to the zip file where the sample is hosted.
string hosted_url = 2;

// The description of the sample project.
string description = 3;
}

// RPC request for listing release channels
message ListReleaseChannelsRequest {
// Required. The name of the resource in the format `projects/{project}`. The
Expand Down
5 changes: 5 additions & 0 deletions google/actions/sdk/v2/config_file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package google.actions.sdk.v2;

import "google/actions/sdk/v2/account_linking_secret.proto";
import "google/actions/sdk/v2/action.proto";
import "google/actions/sdk/v2/interactionmodel/entity_set.proto";
import "google/actions/sdk/v2/interactionmodel/global_intent_event.proto";
import "google/actions/sdk/v2/interactionmodel/intent.proto";
import "google/actions/sdk/v2/interactionmodel/prompt/static_prompt.proto";
Expand Down Expand Up @@ -79,6 +80,10 @@ message ConfigFile {
// Allowed file paths: `custom/types/{language}?/{TypeName}.yaml`
google.actions.sdk.v2.interactionmodel.type.Type type = 8;

// Single entity set definition.
// Allowed file paths: `custom/entitySets/{language}?/{EntitySetName}.yaml`
google.actions.sdk.v2.interactionmodel.EntitySet entity_set = 15;

// Single global intent event definition.
// Allowed file paths: `custom/global/{GlobalIntentEventName}.yaml`
// The file name (GlobalIntentEventName) should be the name of the intent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ message Canvas {

// Optional. Default value: false.
bool suppress_mic = 3;

// If `true` the canvas application occupies the full screen and won't
// have a header at the top. A toast message will also be displayed on the
// loading screen that includes the Action's display name, the developer's
// name, and instructions for exiting the Action. Default value: `false`.
bool enable_full_screen = 8;
}
1 change: 1 addition & 0 deletions google/actions/sdk/v2/interactionmodel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ proto_library(
name = "interactionmodel_proto",
srcs = [
"conditional_event.proto",
"entity_set.proto",
"event_handler.proto",
"global_intent_event.proto",
"intent.proto",
Expand Down
41 changes: 41 additions & 0 deletions google/actions/sdk/v2/interactionmodel/entity_set.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2021 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.interactionmodel;

import "google/api/field_behavior.proto";

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

// Entity sets describe the pre-defined set of entities that the values of
// built-in intent parameters can come from. Entity sets can be referenced from
// entity_set in built-in intent parameters.
message EntitySet {
// An entity a built-in intent parameter value can come from.
message Entity {
// Required. The ID of the entity.
// For a list of built-in-intent parameters and their supported entities,
// see
// https://developers.google.com/assistant/conversational/build/built-in-intents
string id = 1 [(google.api.field_behavior) = REQUIRED];
}

// Required. The list of entities this entity set supports.
repeated Entity entities = 1 [(google.api.field_behavior) = REQUIRED];
}
19 changes: 19 additions & 0 deletions google/actions/sdk/v2/interactionmodel/intent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ option java_package = "com.google.actions.sdk.v2.interactionmodel";
message Intent {
// Definition of a parameter which can be used inside training phrases.
message IntentParameter {
// Entity set references for an intent parameter.
message EntitySetReferences {
// A reference to the set of allowed entities for this intent parameter.
message EntitySetReference {
// Required. Identifies the specific collection of entities to be considered for a
// given parameter. The corresponding entity set definition should be
// present in the custom/entitySets/ directory.
string entity_set = 1 [(google.api.field_behavior) = REQUIRED];
}

// Required. Entity set references for an intent parameter.
repeated EntitySetReference entity_set_references = 1 [(google.api.field_behavior) = REQUIRED];
}

// Required. Unique name of the intent parameter. Can be used in conditions and
// responses to reference intent parameters extracted by NLU with
// $intent.params.[name].resolved
Expand All @@ -42,6 +56,11 @@ message Intent {
// Optional. Declares the data type of this parameter.
// This should not be set for built-in intents.
google.actions.sdk.v2.interactionmodel.type.ClassReference type = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. References to the sets of allowed entities for this intent parameter.
// Only valid for parameters of a built-in intent. These
// references point to entity sets in the 'custom/entitySets' directory.
EntitySetReferences entity_set_references = 3 [(google.api.field_behavior) = OPTIONAL];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ message StaticCanvasPrompt {
// Optional. If `true`, conversation related metadata is included and send back to the
// canvas application.
bool send_state_data_to_canvas_app = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. If `true` the canvas application occupies the full screen and won't
// have a header at the top. A toast message will also be displayed on the
// loading screen that includes the Action's display name, the developer's
// name, and instructions for exiting the Action. Default value: `false`.
bool enable_full_screen = 6 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ message StaticMediaPrompt {
STOPPED = 2;
}

// The types of repeat mode for a list of media objects.
enum RepeatMode {
// Equivalent to OFF.
REPEAT_MODE_UNSPECIFIED = 0;

// End media session at the end of the last media object.
OFF = 1;

// Loop to the beginning of the first media object when the end of the last
// media object is reached.
ALL = 2;
}

// Media type of this response.
MediaType media_type = 8;

Expand All @@ -65,6 +78,9 @@ message StaticMediaPrompt {

// List of media objects.
repeated MediaObject media_objects = 7;

// Repeat mode for the list of Media Objects.
RepeatMode repeat_mode = 9;
}

// Represents a single media object.
Expand Down
12 changes: 6 additions & 6 deletions google/actions/sdk/v2/localized_settings.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ message LocalizedSettings {

// Required. Small square image, 192 x 192 px.
// This should be specified as a reference to the corresponding image in the
// `resources/images/` directory. Eg: `$resources.images.foo` (without the
// `resources/images/` directory. For example, `$resources.images.foo` (without the
// extension) for image in `resources/images/foo.jpg`
// When working on a project pulled from Console the Google managed url pulled
// could be used.
// When working on a project pulled from Console, the Google-managed URL
// pulled could be used. URLs from external sources are not allowed.
string small_logo_image = 5 [(google.api.field_behavior) = REQUIRED];

// Optional. Large landscape image, 1920 x 1080 px.
// This should be specified as a reference to the corresponding image in the
// `resources/images/` directory. Eg: `$resources.images.foo` (without the
// `resources/images/` directory. For example, `$resources.images.foo` (without the
// extension) for image in `resources/images/foo.jpg`
// When working on a project pulled from Console the Google managed url pulled
// could be used.
// When working on a project pulled from Console, the Google-managed URL
// pulled could be used. URLs from external sources are not allowed.
string large_banner_image = 6 [(google.api.field_behavior) = OPTIONAL];

// Required. The name of the developer to be displayed to users.
Expand Down
8 changes: 4 additions & 4 deletions google/actions/sdk/v2/theme_customization.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ message ThemeCustomization {
// This should be specified as a reference to the corresponding image in the
// `resources/images/` directory. Eg: `$resources.images.foo` (without the
// extension) for image in `resources/images/foo.jpg`
// When working on a project pulled from Console, the Google-managed URL
// pulled could be used. URLs from external sources are not allowed.
// When working on a project pulled from Console the Google managed url pulled
// could be used.
string landscape_background_image = 5;

// Portrait mode (minimum 1200x1920 pixels).
// This should be specified as a reference to the corresponding image in the
// `resources/images/` directory. Eg: `$resources.images.foo` (without the
// extension) for image in `resources/images/foo.jpg`
// When working on a project pulled from Console, the Google-managed URL
// pulled could be used. URLs from external sources are not allowed.
// When working on a project pulled from Console the Google managed url pulled
// could be used.
string portrait_background_image = 6;
}

0 comments on commit 0f9e69b

Please sign in to comment.