Skip to content

Commit

Permalink
feat: add subtitle support (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and callmehiphop committed Nov 5, 2019
1 parent 3b3aaca commit ba4648e
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 26 deletions.
1 change: 0 additions & 1 deletion packages/google-cloud-dialogflow/.nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"**/docs",
"**/samples",
"**/scripts",
"**/src/**/v*/**/*.js",
"**/protos",
"**/test",
".jsdoc.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ message Intent {

// Required. List items.
repeated Item items = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. Subtitle of the list.
string subtitle = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The card for presenting a carousel of options to select from.
Expand Down Expand Up @@ -636,10 +639,13 @@ message Intent {
WebhookState webhook_state = 6 [(google.api.field_behavior) = OPTIONAL];

// Optional. The priority of this intent. Higher numbers represent higher
// priorities. If this is zero or unspecified, we use the default
// priority 500000.
// priorities.
//
// Negative numbers mean that the intent is disabled.
// - If the supplied value is unspecified or 0, the service
// translates the value to 500,000, which corresponds to the
// `Normal` priority in the console.
// - If the supplied value is negative, the intent is ignored
// in runtime detect intent requests.
int32 priority = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Indicates whether this is a fallback intent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ message Intent {

// Required. List items.
repeated Item items = 2;

// Optional. Subtitle of the list.
string subtitle = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The card for presenting a carousel of options to select from.
Expand Down Expand Up @@ -1139,11 +1142,14 @@ message Intent {
// Optional. Indicates whether webhooks are enabled for the intent.
WebhookState webhook_state = 6;

// Optional. The priority of this intent. Higher numbers represent higher
// priorities. If this is zero or unspecified, we use the default
// priority 500000.
// The priority of this intent. Higher numbers represent higher
// priorities.
//
// Negative numbers mean that the intent is disabled.
// - If the supplied value is unspecified or 0, the service
// translates the value to 500,000, which corresponds to the
// `Normal` priority in the console.
// - If the supplied value is negative, the intent is ignored
// in runtime detect intent requests.
int32 priority = 3;

// Optional. Indicates whether this is a fallback intent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ message KnowledgeBase {
// Language which represents the KnowledgeBase. When the KnowledgeBase is
// created/updated, this is populated for all non en-us languages. If not
// populated, the default language en-us applies.
string language_code = 3;
string language_code = 4;
}

// Request message for [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBases].
Expand Down
12 changes: 12 additions & 0 deletions packages/google-cloud-dialogflow/protos/protos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6187,6 +6187,9 @@ export namespace google {

/** ListSelect items */
items?: (google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem[]|null);

/** ListSelect subtitle */
subtitle?: (string|null);
}

/** Represents a ListSelect. */
Expand All @@ -6204,6 +6207,9 @@ export namespace google {
/** ListSelect items. */
public items: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem[];

/** ListSelect subtitle. */
public subtitle: string;

/**
* Creates a new ListSelect instance using the specified properties.
* @param [properties] Properties to set
Expand Down Expand Up @@ -18351,6 +18357,9 @@ export namespace google {

/** ListSelect items */
items?: (google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem[]|null);

/** ListSelect subtitle */
subtitle?: (string|null);
}

/** Represents a ListSelect. */
Expand All @@ -18368,6 +18377,9 @@ export namespace google {
/** ListSelect items. */
public items: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem[];

/** ListSelect subtitle. */
public subtitle: string;

/**
* Creates a new ListSelect instance using the specified properties.
* @param [properties] Properties to set
Expand Down
54 changes: 50 additions & 4 deletions packages/google-cloud-dialogflow/protos/protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -14620,6 +14620,7 @@
* @interface IListSelect
* @property {string|null} [title] ListSelect title
* @property {Array.<google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem>|null} [items] ListSelect items
* @property {string|null} [subtitle] ListSelect subtitle
*/

/**
Expand Down Expand Up @@ -14654,6 +14655,14 @@
*/
ListSelect.prototype.items = $util.emptyArray;

/**
* ListSelect subtitle.
* @member {string} subtitle
* @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect
* @instance
*/
ListSelect.prototype.subtitle = "";

/**
* Creates a new ListSelect instance using the specified properties.
* @function create
Expand Down Expand Up @@ -14683,6 +14692,8 @@
if (message.items != null && message.items.length)
for (var i = 0; i < message.items.length; ++i)
$root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.subtitle != null && message.hasOwnProperty("subtitle"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.subtitle);
return writer;
};

Expand Down Expand Up @@ -14725,6 +14736,9 @@
message.items = [];
message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.decode(reader, reader.uint32()));
break;
case 3:
message.subtitle = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
Expand Down Expand Up @@ -14772,6 +14786,9 @@
return "items." + error;
}
}
if (message.subtitle != null && message.hasOwnProperty("subtitle"))
if (!$util.isString(message.subtitle))
return "subtitle: string expected";
return null;
};

Expand Down Expand Up @@ -14799,6 +14816,8 @@
message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.fromObject(object.items[i]);
}
}
if (object.subtitle != null)
message.subtitle = String(object.subtitle);
return message;
};

Expand All @@ -14817,15 +14836,19 @@
var object = {};
if (options.arrays || options.defaults)
object.items = [];
if (options.defaults)
if (options.defaults) {
object.title = "";
object.subtitle = "";
}
if (message.title != null && message.hasOwnProperty("title"))
object.title = message.title;
if (message.items && message.items.length) {
object.items = [];
for (var j = 0; j < message.items.length; ++j)
object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.toObject(message.items[j], options);
}
if (message.subtitle != null && message.hasOwnProperty("subtitle"))
object.subtitle = message.subtitle;
return object;
};

Expand Down Expand Up @@ -43742,6 +43765,7 @@
* @interface IListSelect
* @property {string|null} [title] ListSelect title
* @property {Array.<google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem>|null} [items] ListSelect items
* @property {string|null} [subtitle] ListSelect subtitle
*/

/**
Expand Down Expand Up @@ -43776,6 +43800,14 @@
*/
ListSelect.prototype.items = $util.emptyArray;

/**
* ListSelect subtitle.
* @member {string} subtitle
* @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect
* @instance
*/
ListSelect.prototype.subtitle = "";

/**
* Creates a new ListSelect instance using the specified properties.
* @function create
Expand Down Expand Up @@ -43805,6 +43837,8 @@
if (message.items != null && message.items.length)
for (var i = 0; i < message.items.length; ++i)
$root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
if (message.subtitle != null && message.hasOwnProperty("subtitle"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.subtitle);
return writer;
};

Expand Down Expand Up @@ -43847,6 +43881,9 @@
message.items = [];
message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.decode(reader, reader.uint32()));
break;
case 3:
message.subtitle = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
Expand Down Expand Up @@ -43894,6 +43931,9 @@
return "items." + error;
}
}
if (message.subtitle != null && message.hasOwnProperty("subtitle"))
if (!$util.isString(message.subtitle))
return "subtitle: string expected";
return null;
};

Expand Down Expand Up @@ -43921,6 +43961,8 @@
message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.fromObject(object.items[i]);
}
}
if (object.subtitle != null)
message.subtitle = String(object.subtitle);
return message;
};

Expand All @@ -43939,15 +43981,19 @@
var object = {};
if (options.arrays || options.defaults)
object.items = [];
if (options.defaults)
if (options.defaults) {
object.title = "";
object.subtitle = "";
}
if (message.title != null && message.hasOwnProperty("title"))
object.title = message.title;
if (message.items && message.items.length) {
object.items = [];
for (var j = 0; j < message.items.length; ++j)
object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.toObject(message.items[j], options);
}
if (message.subtitle != null && message.hasOwnProperty("subtitle"))
object.subtitle = message.subtitle;
return object;
};

Expand Down Expand Up @@ -55502,7 +55548,7 @@
if (message.displayName != null && message.hasOwnProperty("displayName"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName);
if (message.languageCode != null && message.hasOwnProperty("languageCode"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode);
writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode);
return writer;
};

Expand Down Expand Up @@ -55543,7 +55589,7 @@
case 2:
message.displayName = reader.string();
break;
case 3:
case 4:
message.languageCode = reader.string();
break;
default:
Expand Down
16 changes: 15 additions & 1 deletion packages/google-cloud-dialogflow/protos/protos.json
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,13 @@
"options": {
"(google.api.field_behavior)": "REQUIRED"
}
},
"subtitle": {
"type": "string",
"id": 3,
"options": {
"(google.api.field_behavior)": "OPTIONAL"
}
}
},
"nested": {
Expand Down Expand Up @@ -4498,6 +4505,13 @@
"rule": "repeated",
"type": "Item",
"id": 2
},
"subtitle": {
"type": "string",
"id": 3,
"options": {
"(google.api.field_behavior)": "OPTIONAL"
}
}
},
"nested": {
Expand Down Expand Up @@ -5443,7 +5457,7 @@
},
"languageCode": {
"type": "string",
"id": 3
"id": 4
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
*
* @property {number} priority
* Optional. The priority of this intent. Higher numbers represent higher
* priorities. If this is zero or unspecified, we use the default
* priority 500000.
* priorities.
*
* Negative numbers mean that the intent is disabled.
* - If the supplied value is unspecified or 0, the service
* translates the value to 500,000, which corresponds to the
* `Normal` priority in the console.
* - If the supplied value is negative, the intent is ignored
* in runtime detect intent requests.
*
* @property {boolean} isFallback
* Optional. Indicates whether this is a fallback intent.
Expand Down Expand Up @@ -613,6 +616,9 @@ const Intent = {
*
* This object should have the same structure as [Item]{@link google.cloud.dialogflow.v2.Item}
*
* @property {string} subtitle
* Optional. Subtitle of the list.
*
* @typedef ListSelect
* @memberof google.cloud.dialogflow.v2
* @see [google.cloud.dialogflow.v2.Intent.Message.ListSelect definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/dialogflow/v2/intent.proto}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@
* The number should be among the values of [WebhookState]{@link google.cloud.dialogflow.v2beta1.WebhookState}
*
* @property {number} priority
* Optional. The priority of this intent. Higher numbers represent higher
* priorities. If this is zero or unspecified, we use the default
* priority 500000.
* The priority of this intent. Higher numbers represent higher
* priorities.
*
* Negative numbers mean that the intent is disabled.
* - If the supplied value is unspecified or 0, the service
* translates the value to 500,000, which corresponds to the
* `Normal` priority in the console.
* - If the supplied value is negative, the intent is ignored
* in runtime detect intent requests.
*
* @property {boolean} isFallback
* Optional. Indicates whether this is a fallback intent.
Expand Down Expand Up @@ -679,6 +682,9 @@ const Intent = {
*
* This object should have the same structure as [Item]{@link google.cloud.dialogflow.v2beta1.Item}
*
* @property {string} subtitle
* Optional. Subtitle of the list.
*
* @typedef ListSelect
* @memberof google.cloud.dialogflow.v2beta1
* @see [google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/dialogflow/v2beta1/intent.proto}
Expand Down
Loading

0 comments on commit ba4648e

Please sign in to comment.