From f6460cea16473d1f208eae4bfa3def7cf5583579 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 16:40:05 -0800 Subject: [PATCH] feat: expose Security Settings API. (#46) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9610e861-65a2-4035-85ab-1303620c4597/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 348481983 Source-Link: https://github.com/googleapis/googleapis/commit/fb36278c9343b7933fed2f19de153797ac27d8f2 --- .../cloud/dialogflow/cx/v3beta1/agent.proto | 1 + .../cx/v3beta1/response_message.proto | 14 +- .../cx/v3beta1/security_settings.proto | 246 ++ protos/protos.d.ts | 1017 +++++++- protos/protos.js | 2241 +++++++++++++++-- protos/protos.json | 272 +- src/v3beta1/agents_client.ts | 62 + src/v3beta1/agents_proto_list.json | 1 + src/v3beta1/entity_types_client.ts | 62 + src/v3beta1/entity_types_proto_list.json | 1 + src/v3beta1/environments_client.ts | 62 + src/v3beta1/environments_proto_list.json | 1 + src/v3beta1/flows_client.ts | 62 + src/v3beta1/flows_proto_list.json | 1 + src/v3beta1/gapic_metadata.json | 68 + src/v3beta1/index.ts | 1 + src/v3beta1/intents_client.ts | 62 + src/v3beta1/intents_proto_list.json | 1 + src/v3beta1/pages_client.ts | 62 + src/v3beta1/pages_proto_list.json | 1 + .../security_settings_service_client.ts | 1977 +++++++++++++++ ...curity_settings_service_client_config.json | 54 + .../security_settings_service_proto_list.json | 17 + src/v3beta1/session_entity_types_client.ts | 62 + .../session_entity_types_proto_list.json | 1 + src/v3beta1/sessions_client.ts | 62 + src/v3beta1/sessions_proto_list.json | 1 + src/v3beta1/transition_route_groups_client.ts | 62 + .../transition_route_groups_proto_list.json | 1 + src/v3beta1/versions_client.ts | 62 + src/v3beta1/versions_proto_list.json | 1 + src/v3beta1/webhooks_client.ts | 62 + src/v3beta1/webhooks_proto_list.json | 1 + synth.metadata | 4 +- test/gapic_agents_v3beta1.ts | 67 + test/gapic_entity_types_v3beta1.ts | 67 + test/gapic_environments_v3beta1.ts | 67 + test/gapic_flows_v3beta1.ts | 67 + test/gapic_intents_v3beta1.ts | 67 + test/gapic_pages_v3beta1.ts | 67 + ...gapic_security_settings_service_v3beta1.ts | 2180 ++++++++++++++++ test/gapic_session_entity_types_v3beta1.ts | 69 + test/gapic_sessions_v3beta1.ts | 67 + test/gapic_transition_route_groups_v3beta1.ts | 69 + test/gapic_versions_v3beta1.ts | 67 + test/gapic_webhooks_v3beta1.ts | 67 + 46 files changed, 9269 insertions(+), 257 deletions(-) create mode 100644 protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto create mode 100644 src/v3beta1/security_settings_service_client.ts create mode 100644 src/v3beta1/security_settings_service_client_config.json create mode 100644 src/v3beta1/security_settings_service_proto_list.json create mode 100644 test/gapic_security_settings_service_v3beta1.ts diff --git a/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto b/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto index 473475d6..d61e307e 100644 --- a/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto +++ b/protos/google/cloud/dialogflow/cx/v3beta1/agent.proto @@ -21,6 +21,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/dialogflow/cx/v3beta1/flow.proto"; +import "google/cloud/dialogflow/cx/v3beta1/security_settings.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; diff --git a/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto b/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto index ac3b61cd..431cc66f 100644 --- a/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto +++ b/protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto @@ -125,13 +125,6 @@ message ResponseMessage { bool allow_playback_interruption = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } - // Indicates that interaction with the Dialogflow agent has ended. - // This message is generated by Dialogflow only and not supposed to be - // defined by the user. - message EndInteraction { - - } - // Represents an audio message that is composed of both segments // synthesized from the Dialogflow agent prompts and ones hosted externally // at the specified URIs. @@ -163,6 +156,13 @@ message ResponseMessage { repeated Segment segments = 1; } + // Indicates that interaction with the Dialogflow agent has ended. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message EndInteraction { + + } + // Required. The rich response message. oneof message { // Returns a text response. diff --git a/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto b/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto new file mode 100644 index 00000000..e86c9942 --- /dev/null +++ b/protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto @@ -0,0 +1,246 @@ +// 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.cloud.dialogflow.cx.v3beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx"; +option java_multiple_files = true; +option java_outer_classname = "SecuritySettingsProto"; +option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; +option objc_class_prefix = "DF"; + +// Service for managing security settings for Dialogflow. +service SecuritySettingsService { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Create security settings in the specified location. + rpc CreateSecuritySettings(CreateSecuritySettingsRequest) returns (SecuritySettings) { + option (google.api.http) = { + post: "/v3beta1/{parent=projects/*/locations/*}/securitySettings" + body: "security_settings" + }; + option (google.api.method_signature) = "parent,security_settings"; + } + + // Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. + // The returned settings may be stale by up to 1 minute. + rpc GetSecuritySettings(GetSecuritySettingsRequest) returns (SecuritySettings) { + option (google.api.http) = { + get: "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. + rpc UpdateSecuritySettings(UpdateSecuritySettingsRequest) returns (SecuritySettings) { + option (google.api.http) = { + patch: "/v3beta1/{security_settings.name=projects/*/locations/*/securitySettings/*}" + body: "security_settings" + }; + option (google.api.method_signature) = "security_settings,update_mask"; + } + + // Returns the list of all security settings in the specified location. + rpc ListSecuritySettings(ListSecuritySettingsRequest) returns (ListSecuritySettingsResponse) { + option (google.api.http) = { + get: "/v3beta1/{parent=projects/*/locations/*}/securitySettings" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. + rpc DeleteSecuritySettings(DeleteSecuritySettingsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettings]. +message GetSecuritySettingsRequest { + // Required. Resource name of the settings. + // Format: `projects//locations//securitySettings/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; +} + +// The request message for [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettings]. +message UpdateSecuritySettingsRequest { + // Required. [SecuritySettings] object that contains values for each of the + // fields to update. + SecuritySettings security_settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields get updated. If the mask is not present, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SecuritySettings.ListSecuritySettings][]. +message ListSecuritySettingsRequest { + // Required. The location to list all security settings for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; + + // The maximum number of items to return in a single page. By default 20 and + // at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [SecuritySettings.ListSecuritySettings][]. +message ListSecuritySettingsResponse { + // The list of security settings. + repeated SecuritySettings security_settings = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// The request message for [SecuritySettings.CreateSecuritySettings][]. +message CreateSecuritySettingsRequest { + // Required. The location to create an [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; + + // Required. The security settings to create. + SecuritySettings security_settings = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [SecuritySettings.DeleteSecuritySettings][]. +message DeleteSecuritySettingsRequest { + // Required. The name of the [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings] to delete. + // Format: `projects//locations//securitySettings/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/SecuritySettings" + } + ]; +} + +// Represents the settings related to security issues, such as data redaction +// and data retention. It may take hours for updates on the settings to +// propagate to all the related components and take effect. +message SecuritySettings { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/SecuritySettings" + pattern: "projects/{project}/locations/{location}/securitySettings/{security_settings}" + }; + + // Defines how we redact data. + enum RedactionStrategy { + // Do not redact. + REDACTION_STRATEGY_UNSPECIFIED = 0; + + // Call redaction service to clean up the data to be persisted. + REDACT_WITH_SERVICE = 1; + } + + // Defines what types of data to redact. + enum RedactionScope { + // Don't redact any kind of data. + REDACTION_SCOPE_UNSPECIFIED = 0; + + // On data to be written to disk or similar devices that are capable of + // holding data even if power is disconnected. This includes data that are + // temporarily saved on disk. + REDACT_DISK_STORAGE = 2; + } + + // Type of data we purge after retention settings triggers purge. + enum PurgeDataType { + // Unspecified. Do not use. + PURGE_DATA_TYPE_UNSPECIFIED = 0; + + // Dialogflow history. This does not include Stackdriver log, which is + // owned by the user not Dialogflow. + DIALOGFLOW_HISTORY = 1; + } + + // Required. Resource name of the settings. + // Format: `projects//locations//securitySettings/`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The human-readable name of the security settings, unique within the + // location. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Strategy that defines how we do redaction. + RedactionStrategy redaction_strategy = 3; + + // Defines on what data we apply redaction. Note that we don't + // redact data to which we don't have access, e.g., Stackdriver logs. + RedactionScope redaction_scope = 4; + + // DLP inspect template name. Use this template to define inspect base + // settings. + // + // If empty, we use the default DLP inspect config. + // + // The template name will have one of the following formats: + // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR + // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` + string inspect_template = 9; + + // Specifies how data is retained. Note that even if the data is + // purged due to retention policy, we may still hold it in backup storage for + // a few days without allowing direct readings. + oneof data_retention { + // Retains the data for the specified number of days. + // User must Set a value lower than Dialogflow's default 30d TTL. Setting a + // value higher than that has no effect. + // A missing value or setting to 0 also means we use Dialogflow's default + // TTL. + int32 retention_window_days = 6; + } + + // List of types of data to remove when retention settings triggers purge. + repeated PurgeDataType purge_data_types = 8; +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 5f783902..528b44fb 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -21767,90 +21767,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an EndInteraction. */ - interface IEndInteraction { - } - - /** Represents an EndInteraction. */ - class EndInteraction implements IEndInteraction { - - /** - * Constructs a new EndInteraction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction); - - /** - * Creates a new EndInteraction instance using the specified properties. - * @param [properties] Properties to set - * @returns EndInteraction instance - */ - public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; - - /** - * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. - * @param message EndInteraction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. - * @param message EndInteraction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EndInteraction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EndInteraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; - - /** - * Decodes an EndInteraction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EndInteraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; - - /** - * Verifies an EndInteraction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EndInteraction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; - - /** - * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. - * @param message EndInteraction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EndInteraction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a MixedAudio. */ interface IMixedAudio { @@ -22048,6 +21964,939 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Properties of an EndInteraction. */ + interface IEndInteraction { + } + + /** Represents an EndInteraction. */ + class EndInteraction implements IEndInteraction { + + /** + * Constructs a new EndInteraction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction); + + /** + * Creates a new EndInteraction instance using the specified properties. + * @param [properties] Properties to set + * @returns EndInteraction instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Verifies an EndInteraction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndInteraction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @param message EndInteraction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndInteraction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Represents a SecuritySettingsService */ + class SecuritySettingsService extends $protobuf.rpc.Service { + + /** + * Constructs a new SecuritySettingsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new SecuritySettingsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SecuritySettingsService; + + /** + * Calls CreateSecuritySettings. + * @param request CreateSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public createSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.CreateSecuritySettingsCallback): void; + + /** + * Calls CreateSecuritySettings. + * @param request CreateSecuritySettingsRequest message or plain object + * @returns Promise + */ + public createSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest): Promise; + + /** + * Calls GetSecuritySettings. + * @param request GetSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public getSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettingsCallback): void; + + /** + * Calls GetSecuritySettings. + * @param request GetSecuritySettingsRequest message or plain object + * @returns Promise + */ + public getSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest): Promise; + + /** + * Calls UpdateSecuritySettings. + * @param request UpdateSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecuritySettings + */ + public updateSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettingsCallback): void; + + /** + * Calls UpdateSecuritySettings. + * @param request UpdateSecuritySettingsRequest message or plain object + * @returns Promise + */ + public updateSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest): Promise; + + /** + * Calls ListSecuritySettings. + * @param request ListSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecuritySettingsResponse + */ + public listSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.ListSecuritySettingsCallback): void; + + /** + * Calls ListSecuritySettings. + * @param request ListSecuritySettingsRequest message or plain object + * @returns Promise + */ + public listSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest): Promise; + + /** + * Calls DeleteSecuritySettings. + * @param request DeleteSecuritySettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, callback: google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.DeleteSecuritySettingsCallback): void; + + /** + * Calls DeleteSecuritySettings. + * @param request DeleteSecuritySettingsRequest message or plain object + * @returns Promise + */ + public deleteSecuritySettings(request: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest): Promise; + } + + namespace SecuritySettingsService { + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#createSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type CreateSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#getSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type GetSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#updateSecuritySettings}. + * @param error Error, if any + * @param [response] SecuritySettings + */ + type UpdateSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.SecuritySettings) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#listSecuritySettings}. + * @param error Error, if any + * @param [response] ListSecuritySettingsResponse + */ + type ListSecuritySettingsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#deleteSecuritySettings}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSecuritySettingsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetSecuritySettingsRequest. */ + interface IGetSecuritySettingsRequest { + + /** GetSecuritySettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetSecuritySettingsRequest. */ + class GetSecuritySettingsRequest implements IGetSecuritySettingsRequest { + + /** + * Constructs a new GetSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest); + + /** GetSecuritySettingsRequest name. */ + public name: string; + + /** + * Creates a new GetSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Encodes the specified GetSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @param message GetSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @param message GetSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Verifies a GetSecuritySettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest; + + /** + * Creates a plain object from a GetSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message GetSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateSecuritySettingsRequest. */ + interface IUpdateSecuritySettingsRequest { + + /** UpdateSecuritySettingsRequest securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + + /** UpdateSecuritySettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSecuritySettingsRequest. */ + class UpdateSecuritySettingsRequest implements IUpdateSecuritySettingsRequest { + + /** + * Constructs a new UpdateSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest); + + /** UpdateSecuritySettingsRequest securitySettings. */ + public securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + + /** UpdateSecuritySettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @param message UpdateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @param message UpdateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Verifies an UpdateSecuritySettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest; + + /** + * Creates a plain object from an UpdateSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message UpdateSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSecuritySettingsRequest. */ + interface IListSecuritySettingsRequest { + + /** ListSecuritySettingsRequest parent */ + parent?: (string|null); + + /** ListSecuritySettingsRequest pageSize */ + pageSize?: (number|null); + + /** ListSecuritySettingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSecuritySettingsRequest. */ + class ListSecuritySettingsRequest implements IListSecuritySettingsRequest { + + /** + * Constructs a new ListSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest); + + /** ListSecuritySettingsRequest parent. */ + public parent: string; + + /** ListSecuritySettingsRequest pageSize. */ + public pageSize: number; + + /** ListSecuritySettingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Encodes the specified ListSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @param message ListSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @param message ListSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Verifies a ListSecuritySettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest; + + /** + * Creates a plain object from a ListSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message ListSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSecuritySettingsResponse. */ + interface IListSecuritySettingsResponse { + + /** ListSecuritySettingsResponse securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[]|null); + + /** ListSecuritySettingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSecuritySettingsResponse. */ + class ListSecuritySettingsResponse implements IListSecuritySettingsResponse { + + /** + * Constructs a new ListSecuritySettingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse); + + /** ListSecuritySettingsResponse securitySettings. */ + public securitySettings: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[]; + + /** ListSecuritySettingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSecuritySettingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecuritySettingsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Encodes the specified ListSecuritySettingsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @param message ListSecuritySettingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecuritySettingsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @param message ListSecuritySettingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Verifies a ListSecuritySettingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecuritySettingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecuritySettingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse; + + /** + * Creates a plain object from a ListSecuritySettingsResponse message. Also converts values to other types if specified. + * @param message ListSecuritySettingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecuritySettingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSecuritySettingsRequest. */ + interface ICreateSecuritySettingsRequest { + + /** CreateSecuritySettingsRequest parent */ + parent?: (string|null); + + /** CreateSecuritySettingsRequest securitySettings */ + securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + } + + /** Represents a CreateSecuritySettingsRequest. */ + class CreateSecuritySettingsRequest implements ICreateSecuritySettingsRequest { + + /** + * Constructs a new CreateSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest); + + /** CreateSecuritySettingsRequest parent. */ + public parent: string; + + /** CreateSecuritySettingsRequest securitySettings. */ + public securitySettings?: (google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null); + + /** + * Creates a new CreateSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Encodes the specified CreateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @param message CreateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @param message CreateSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Verifies a CreateSecuritySettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest; + + /** + * Creates a plain object from a CreateSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message CreateSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSecuritySettingsRequest. */ + interface IDeleteSecuritySettingsRequest { + + /** DeleteSecuritySettingsRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSecuritySettingsRequest. */ + class DeleteSecuritySettingsRequest implements IDeleteSecuritySettingsRequest { + + /** + * Constructs a new DeleteSecuritySettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest); + + /** DeleteSecuritySettingsRequest name. */ + public name: string; + + /** + * Creates a new DeleteSecuritySettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecuritySettingsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest): google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @param message DeleteSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @param message DeleteSecuritySettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Verifies a DeleteSecuritySettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecuritySettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest; + + /** + * Creates a plain object from a DeleteSecuritySettingsRequest message. Also converts values to other types if specified. + * @param message DeleteSecuritySettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSecuritySettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings name */ + name?: (string|null); + + /** SecuritySettings displayName */ + displayName?: (string|null); + + /** SecuritySettings redactionStrategy */ + redactionStrategy?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|null); + + /** SecuritySettings redactionScope */ + redactionScope?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|null); + + /** SecuritySettings inspectTemplate */ + inspectTemplate?: (string|null); + + /** SecuritySettings retentionWindowDays */ + retentionWindowDays?: (number|null); + + /** SecuritySettings purgeDataTypes */ + purgeDataTypes?: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[]|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings); + + /** SecuritySettings name. */ + public name: string; + + /** SecuritySettings displayName. */ + public displayName: string; + + /** SecuritySettings redactionStrategy. */ + public redactionStrategy: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy); + + /** SecuritySettings redactionScope. */ + public redactionScope: (google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|keyof typeof google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope); + + /** SecuritySettings inspectTemplate. */ + public inspectTemplate: string; + + /** SecuritySettings retentionWindowDays. */ + public retentionWindowDays: number; + + /** SecuritySettings purgeDataTypes. */ + public purgeDataTypes: google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[]; + + /** SecuritySettings dataRetention. */ + public dataRetention?: "retentionWindowDays"; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings): google.cloud.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Verifies a SecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3beta1.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3beta1.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SecuritySettings { + + /** RedactionStrategy enum. */ + enum RedactionStrategy { + REDACTION_STRATEGY_UNSPECIFIED = 0, + REDACT_WITH_SERVICE = 1 + } + + /** RedactionScope enum. */ + enum RedactionScope { + REDACTION_SCOPE_UNSPECIFIED = 0, + REDACT_DISK_STORAGE = 2 + } + + /** PurgeDataType enum. */ + enum PurgeDataType { + PURGE_DATA_TYPE_UNSPECIFIED = 0, + DIALOGFLOW_HISTORY = 1 + } } /** Properties of a SpeechWordInfo. */ diff --git a/protos/protos.js b/protos/protos.js index 1feaee69..a4620fc8 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -50865,166 +50865,6 @@ return PlayAudio; })(); - ResponseMessage.EndInteraction = (function() { - - /** - * Properties of an EndInteraction. - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage - * @interface IEndInteraction - */ - - /** - * Constructs a new EndInteraction. - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage - * @classdesc Represents an EndInteraction. - * @implements IEndInteraction - * @constructor - * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set - */ - function EndInteraction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new EndInteraction instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set - * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction instance - */ - EndInteraction.create = function create(properties) { - return new EndInteraction(properties); - }; - - /** - * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndInteraction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndInteraction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndInteraction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndInteraction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndInteraction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndInteraction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndInteraction message. - * @function verify - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndInteraction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction - */ - EndInteraction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - return object; - return new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); - }; - - /** - * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @static - * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} message EndInteraction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndInteraction.toObject = function toObject() { - return {}; - }; - - /** - * Converts this EndInteraction to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - * @instance - * @returns {Object.} JSON object - */ - EndInteraction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EndInteraction; - })(); - ResponseMessage.MixedAudio = (function() { /** @@ -51492,7 +51332,2086 @@ return MixedAudio; })(); - return ResponseMessage; + ResponseMessage.EndInteraction = (function() { + + /** + * Properties of an EndInteraction. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @interface IEndInteraction + */ + + /** + * Constructs a new EndInteraction. + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage + * @classdesc Represents an EndInteraction. + * @implements IEndInteraction + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set + */ + function EndInteraction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new EndInteraction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction instance + */ + EndInteraction.create = function create(properties) { + return new EndInteraction(properties); + }; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndInteraction message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndInteraction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} EndInteraction + */ + EndInteraction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + return object; + return new $root.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); + }; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} message EndInteraction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndInteraction.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EndInteraction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + * @instance + * @returns {Object.} JSON object + */ + EndInteraction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EndInteraction; + })(); + + return ResponseMessage; + })(); + + v3beta1.SecuritySettingsService = (function() { + + /** + * Constructs a new SecuritySettingsService service. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SecuritySettingsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SecuritySettingsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecuritySettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecuritySettingsService; + + /** + * Creates new SecuritySettingsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SecuritySettingsService} RPC service. Useful where requests and/or responses are streamed. + */ + SecuritySettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#createSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef CreateSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls CreateSecuritySettings. + * @function createSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} request CreateSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.CreateSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.createSecuritySettings = function createSecuritySettings(request, callback) { + return this.rpcCall(createSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, request, callback); + }, "name", { value: "CreateSecuritySettings" }); + + /** + * Calls CreateSecuritySettings. + * @function createSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} request CreateSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#getSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef GetSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls GetSecuritySettings. + * @function getSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} request GetSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.getSecuritySettings = function getSecuritySettings(request, callback) { + return this.rpcCall(getSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, request, callback); + }, "name", { value: "GetSecuritySettings" }); + + /** + * Calls GetSecuritySettings. + * @function getSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} request GetSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#updateSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef UpdateSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} [response] SecuritySettings + */ + + /** + * Calls UpdateSecuritySettings. + * @function updateSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} request UpdateSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettingsCallback} callback Node-style callback called with the error, if any, and SecuritySettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.updateSecuritySettings = function updateSecuritySettings(request, callback) { + return this.rpcCall(updateSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings, request, callback); + }, "name", { value: "UpdateSecuritySettings" }); + + /** + * Calls UpdateSecuritySettings. + * @function updateSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} request UpdateSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#listSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef ListSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} [response] ListSecuritySettingsResponse + */ + + /** + * Calls ListSecuritySettings. + * @function listSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} request ListSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.ListSecuritySettingsCallback} callback Node-style callback called with the error, if any, and ListSecuritySettingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.listSecuritySettings = function listSecuritySettings(request, callback) { + return this.rpcCall(listSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest, $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse, request, callback); + }, "name", { value: "ListSecuritySettings" }); + + /** + * Calls ListSecuritySettings. + * @function listSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} request ListSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService#deleteSecuritySettings}. + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @typedef DeleteSecuritySettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSecuritySettings. + * @function deleteSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} request DeleteSecuritySettingsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.DeleteSecuritySettingsCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecuritySettingsService.prototype.deleteSecuritySettings = function deleteSecuritySettings(request, callback) { + return this.rpcCall(deleteSecuritySettings, $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSecuritySettings" }); + + /** + * Calls DeleteSecuritySettings. + * @function deleteSecuritySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService + * @instance + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} request DeleteSecuritySettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecuritySettingsService; + })(); + + v3beta1.GetSecuritySettingsRequest = (function() { + + /** + * Properties of a GetSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IGetSecuritySettingsRequest + * @property {string|null} [name] GetSecuritySettingsRequest name + */ + + /** + * Constructs a new GetSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a GetSecuritySettingsRequest. + * @implements IGetSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest=} [properties] Properties to set + */ + function GetSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecuritySettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @instance + */ + GetSecuritySettingsRequest.prototype.name = ""; + + /** + * Creates a new GetSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest instance + */ + GetSecuritySettingsRequest.create = function create(properties) { + return new GetSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified GetSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} message GetSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest} message GetSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecuritySettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecuritySettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} GetSecuritySettingsRequest + */ + GetSecuritySettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest} message GetSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSecuritySettingsRequest; + })(); + + v3beta1.UpdateSecuritySettingsRequest = (function() { + + /** + * Properties of an UpdateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IUpdateSecuritySettingsRequest + * @property {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null} [securitySettings] UpdateSecuritySettingsRequest securitySettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecuritySettingsRequest updateMask + */ + + /** + * Constructs a new UpdateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents an UpdateSecuritySettingsRequest. + * @implements IUpdateSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest=} [properties] Properties to set + */ + function UpdateSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSecuritySettingsRequest securitySettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @instance + */ + UpdateSecuritySettingsRequest.prototype.securitySettings = null; + + /** + * UpdateSecuritySettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @instance + */ + UpdateSecuritySettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest instance + */ + UpdateSecuritySettingsRequest.create = function create(properties) { + return new UpdateSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecuritySettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSecuritySettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify(message.securitySettings); + if (error) + return "securitySettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} UpdateSecuritySettingsRequest + */ + UpdateSecuritySettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest(); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.fromObject(object.securitySettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest} message UpdateSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securitySettings = null; + object.updateMask = null; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.toObject(message.securitySettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateSecuritySettingsRequest; + })(); + + v3beta1.ListSecuritySettingsRequest = (function() { + + /** + * Properties of a ListSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListSecuritySettingsRequest + * @property {string|null} [parent] ListSecuritySettingsRequest parent + * @property {number|null} [pageSize] ListSecuritySettingsRequest pageSize + * @property {string|null} [pageToken] ListSecuritySettingsRequest pageToken + */ + + /** + * Constructs a new ListSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListSecuritySettingsRequest. + * @implements IListSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest=} [properties] Properties to set + */ + function ListSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecuritySettingsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.parent = ""; + + /** + * ListSecuritySettingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.pageSize = 0; + + /** + * ListSecuritySettingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + */ + ListSecuritySettingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest instance + */ + ListSecuritySettingsRequest.create = function create(properties) { + return new ListSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified ListSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} message ListSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest} message ListSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecuritySettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} ListSecuritySettingsRequest + */ + ListSecuritySettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest} message ListSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSecuritySettingsRequest; + })(); + + v3beta1.ListSecuritySettingsResponse = (function() { + + /** + * Properties of a ListSecuritySettingsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IListSecuritySettingsResponse + * @property {Array.|null} [securitySettings] ListSecuritySettingsResponse securitySettings + * @property {string|null} [nextPageToken] ListSecuritySettingsResponse nextPageToken + */ + + /** + * Constructs a new ListSecuritySettingsResponse. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a ListSecuritySettingsResponse. + * @implements IListSecuritySettingsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse=} [properties] Properties to set + */ + function ListSecuritySettingsResponse(properties) { + this.securitySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecuritySettingsResponse securitySettings. + * @member {Array.} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @instance + */ + ListSecuritySettingsResponse.prototype.securitySettings = $util.emptyArray; + + /** + * ListSecuritySettingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @instance + */ + ListSecuritySettingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSecuritySettingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse instance + */ + ListSecuritySettingsResponse.create = function create(properties) { + return new ListSecuritySettingsResponse(properties); + }; + + /** + * Encodes the specified ListSecuritySettingsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse} message ListSecuritySettingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securitySettings != null && message.securitySettings.length) + for (var i = 0; i < message.securitySettings.length; ++i) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.encode(message.securitySettings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSecuritySettingsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse} message ListSecuritySettingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecuritySettingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.securitySettings && message.securitySettings.length)) + message.securitySettings = []; + message.securitySettings.push($root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecuritySettingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecuritySettingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecuritySettingsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecuritySettingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + if (!Array.isArray(message.securitySettings)) + return "securitySettings: array expected"; + for (var i = 0; i < message.securitySettings.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify(message.securitySettings[i]); + if (error) + return "securitySettings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSecuritySettingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} ListSecuritySettingsResponse + */ + ListSecuritySettingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse(); + if (object.securitySettings) { + if (!Array.isArray(object.securitySettings)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.securitySettings: array expected"); + message.securitySettings = []; + for (var i = 0; i < object.securitySettings.length; ++i) { + if (typeof object.securitySettings[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse.securitySettings: object expected"); + message.securitySettings[i] = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.fromObject(object.securitySettings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSecuritySettingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse} message ListSecuritySettingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecuritySettingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.securitySettings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.securitySettings && message.securitySettings.length) { + object.securitySettings = []; + for (var j = 0; j < message.securitySettings.length; ++j) + object.securitySettings[j] = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.toObject(message.securitySettings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSecuritySettingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSecuritySettingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSecuritySettingsResponse; + })(); + + v3beta1.CreateSecuritySettingsRequest = (function() { + + /** + * Properties of a CreateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ICreateSecuritySettingsRequest + * @property {string|null} [parent] CreateSecuritySettingsRequest parent + * @property {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null} [securitySettings] CreateSecuritySettingsRequest securitySettings + */ + + /** + * Constructs a new CreateSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a CreateSecuritySettingsRequest. + * @implements ICreateSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest=} [properties] Properties to set + */ + function CreateSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSecuritySettingsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @instance + */ + CreateSecuritySettingsRequest.prototype.parent = ""; + + /** + * CreateSecuritySettingsRequest securitySettings. + * @member {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @instance + */ + CreateSecuritySettingsRequest.prototype.securitySettings = null; + + /** + * Creates a new CreateSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest instance + */ + CreateSecuritySettingsRequest.create = function create(properties) { + return new CreateSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified CreateSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} message CreateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest} message CreateSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecuritySettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSecuritySettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + var error = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify(message.securitySettings); + if (error) + return "securitySettings." + error; + } + return null; + }; + + /** + * Creates a CreateSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} CreateSecuritySettingsRequest + */ + CreateSecuritySettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.fromObject(object.securitySettings); + } + return message; + }; + + /** + * Creates a plain object from a CreateSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest} message CreateSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.securitySettings = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) + object.securitySettings = $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.toObject(message.securitySettings, options); + return object; + }; + + /** + * Converts this CreateSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSecuritySettingsRequest; + })(); + + v3beta1.DeleteSecuritySettingsRequest = (function() { + + /** + * Properties of a DeleteSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface IDeleteSecuritySettingsRequest + * @property {string|null} [name] DeleteSecuritySettingsRequest name + */ + + /** + * Constructs a new DeleteSecuritySettingsRequest. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a DeleteSecuritySettingsRequest. + * @implements IDeleteSecuritySettingsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest=} [properties] Properties to set + */ + function DeleteSecuritySettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecuritySettingsRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @instance + */ + DeleteSecuritySettingsRequest.prototype.name = ""; + + /** + * Creates a new DeleteSecuritySettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest instance + */ + DeleteSecuritySettingsRequest.create = function create(properties) { + return new DeleteSecuritySettingsRequest(properties); + }; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecuritySettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSecuritySettingsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecuritySettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecuritySettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSecuritySettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecuritySettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecuritySettingsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecuritySettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSecuritySettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} DeleteSecuritySettingsRequest + */ + DeleteSecuritySettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSecuritySettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest} message DeleteSecuritySettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecuritySettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteSecuritySettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecuritySettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSecuritySettingsRequest; + })(); + + v3beta1.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @interface ISecuritySettings + * @property {string|null} [name] SecuritySettings name + * @property {string|null} [displayName] SecuritySettings displayName + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy|null} [redactionStrategy] SecuritySettings redactionStrategy + * @property {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope|null} [redactionScope] SecuritySettings redactionScope + * @property {string|null} [inspectTemplate] SecuritySettings inspectTemplate + * @property {number|null} [retentionWindowDays] SecuritySettings retentionWindowDays + * @property {Array.|null} [purgeDataTypes] SecuritySettings purgeDataTypes + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.dialogflow.cx.v3beta1 + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.purgeDataTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.name = ""; + + /** + * SecuritySettings displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.displayName = ""; + + /** + * SecuritySettings redactionStrategy. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy} redactionStrategy + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.redactionStrategy = 0; + + /** + * SecuritySettings redactionScope. + * @member {google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope} redactionScope + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.redactionScope = 0; + + /** + * SecuritySettings inspectTemplate. + * @member {string} inspectTemplate + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.inspectTemplate = ""; + + /** + * SecuritySettings retentionWindowDays. + * @member {number} retentionWindowDays + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.retentionWindowDays = 0; + + /** + * SecuritySettings purgeDataTypes. + * @member {Array.} purgeDataTypes + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.purgeDataTypes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecuritySettings dataRetention. + * @member {"retentionWindowDays"|undefined} dataRetention + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + */ + Object.defineProperty(SecuritySettings.prototype, "dataRetention", { + get: $util.oneOfGetter($oneOfFields = ["retentionWindowDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.redactionStrategy != null && Object.hasOwnProperty.call(message, "redactionStrategy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.redactionStrategy); + if (message.redactionScope != null && Object.hasOwnProperty.call(message, "redactionScope")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.redactionScope); + if (message.retentionWindowDays != null && Object.hasOwnProperty.call(message, "retentionWindowDays")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.retentionWindowDays); + if (message.purgeDataTypes != null && message.purgeDataTypes.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.purgeDataTypes.length; ++i) + writer.int32(message.purgeDataTypes[i]); + writer.ldelim(); + } + if (message.inspectTemplate != null && Object.hasOwnProperty.call(message, "inspectTemplate")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.inspectTemplate); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.redactionStrategy = reader.int32(); + break; + case 4: + message.redactionScope = reader.int32(); + break; + case 9: + message.inspectTemplate = reader.string(); + break; + case 6: + message.retentionWindowDays = reader.int32(); + break; + case 8: + if (!(message.purgeDataTypes && message.purgeDataTypes.length)) + message.purgeDataTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.purgeDataTypes.push(reader.int32()); + } else + message.purgeDataTypes.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.redactionStrategy != null && message.hasOwnProperty("redactionStrategy")) + switch (message.redactionStrategy) { + default: + return "redactionStrategy: enum value expected"; + case 0: + case 1: + break; + } + if (message.redactionScope != null && message.hasOwnProperty("redactionScope")) + switch (message.redactionScope) { + default: + return "redactionScope: enum value expected"; + case 0: + case 2: + break; + } + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + if (!$util.isString(message.inspectTemplate)) + return "inspectTemplate: string expected"; + if (message.retentionWindowDays != null && message.hasOwnProperty("retentionWindowDays")) { + properties.dataRetention = 1; + if (!$util.isInteger(message.retentionWindowDays)) + return "retentionWindowDays: integer expected"; + } + if (message.purgeDataTypes != null && message.hasOwnProperty("purgeDataTypes")) { + if (!Array.isArray(message.purgeDataTypes)) + return "purgeDataTypes: array expected"; + for (var i = 0; i < message.purgeDataTypes.length; ++i) + switch (message.purgeDataTypes[i]) { + default: + return "purgeDataTypes: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.redactionStrategy) { + case "REDACTION_STRATEGY_UNSPECIFIED": + case 0: + message.redactionStrategy = 0; + break; + case "REDACT_WITH_SERVICE": + case 1: + message.redactionStrategy = 1; + break; + } + switch (object.redactionScope) { + case "REDACTION_SCOPE_UNSPECIFIED": + case 0: + message.redactionScope = 0; + break; + case "REDACT_DISK_STORAGE": + case 2: + message.redactionScope = 2; + break; + } + if (object.inspectTemplate != null) + message.inspectTemplate = String(object.inspectTemplate); + if (object.retentionWindowDays != null) + message.retentionWindowDays = object.retentionWindowDays | 0; + if (object.purgeDataTypes) { + if (!Array.isArray(object.purgeDataTypes)) + throw TypeError(".google.cloud.dialogflow.cx.v3beta1.SecuritySettings.purgeDataTypes: array expected"); + message.purgeDataTypes = []; + for (var i = 0; i < object.purgeDataTypes.length; ++i) + switch (object.purgeDataTypes[i]) { + default: + case "PURGE_DATA_TYPE_UNSPECIFIED": + case 0: + message.purgeDataTypes[i] = 0; + break; + case "DIALOGFLOW_HISTORY": + case 1: + message.purgeDataTypes[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @static + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purgeDataTypes = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.redactionStrategy = options.enums === String ? "REDACTION_STRATEGY_UNSPECIFIED" : 0; + object.redactionScope = options.enums === String ? "REDACTION_SCOPE_UNSPECIFIED" : 0; + object.inspectTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.redactionStrategy != null && message.hasOwnProperty("redactionStrategy")) + object.redactionStrategy = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy[message.redactionStrategy] : message.redactionStrategy; + if (message.redactionScope != null && message.hasOwnProperty("redactionScope")) + object.redactionScope = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope[message.redactionScope] : message.redactionScope; + if (message.retentionWindowDays != null && message.hasOwnProperty("retentionWindowDays")) { + object.retentionWindowDays = message.retentionWindowDays; + if (options.oneofs) + object.dataRetention = "retentionWindowDays"; + } + if (message.purgeDataTypes && message.purgeDataTypes.length) { + object.purgeDataTypes = []; + for (var j = 0; j < message.purgeDataTypes.length; ++j) + object.purgeDataTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType[message.purgeDataTypes[j]] : message.purgeDataTypes[j]; + } + if (message.inspectTemplate != null && message.hasOwnProperty("inspectTemplate")) + object.inspectTemplate = message.inspectTemplate; + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3beta1.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * RedactionStrategy enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionStrategy + * @enum {number} + * @property {number} REDACTION_STRATEGY_UNSPECIFIED=0 REDACTION_STRATEGY_UNSPECIFIED value + * @property {number} REDACT_WITH_SERVICE=1 REDACT_WITH_SERVICE value + */ + SecuritySettings.RedactionStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDACTION_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REDACT_WITH_SERVICE"] = 1; + return values; + })(); + + /** + * RedactionScope enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.RedactionScope + * @enum {number} + * @property {number} REDACTION_SCOPE_UNSPECIFIED=0 REDACTION_SCOPE_UNSPECIFIED value + * @property {number} REDACT_DISK_STORAGE=2 REDACT_DISK_STORAGE value + */ + SecuritySettings.RedactionScope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDACTION_SCOPE_UNSPECIFIED"] = 0; + values[valuesById[2] = "REDACT_DISK_STORAGE"] = 2; + return values; + })(); + + /** + * PurgeDataType enum. + * @name google.cloud.dialogflow.cx.v3beta1.SecuritySettings.PurgeDataType + * @enum {number} + * @property {number} PURGE_DATA_TYPE_UNSPECIFIED=0 PURGE_DATA_TYPE_UNSPECIFIED value + * @property {number} DIALOGFLOW_HISTORY=1 DIALOGFLOW_HISTORY value + */ + SecuritySettings.PurgeDataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PURGE_DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIALOGFLOW_HISTORY"] = 1; + return values; + })(); + + return SecuritySettings; })(); v3beta1.SpeechWordInfo = (function() { diff --git a/protos/protos.json b/protos/protos.json index 3a735454..1a8edb54 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -6017,9 +6017,6 @@ } } }, - "EndInteraction": { - "fields": {} - }, "MixedAudio": { "fields": { "segments": { @@ -6057,6 +6054,275 @@ } } } + }, + "EndInteraction": { + "fields": {} + } + } + }, + "SecuritySettingsService": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateSecuritySettings": { + "requestType": "CreateSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).post": "/v3beta1/{parent=projects/*/locations/*}/securitySettings", + "(google.api.http).body": "security_settings", + "(google.api.method_signature)": "parent,security_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3beta1/{parent=projects/*/locations/*}/securitySettings", + "body": "security_settings" + } + }, + { + "(google.api.method_signature)": "parent,security_settings" + } + ] + }, + "GetSecuritySettings": { + "requestType": "GetSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).get": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSecuritySettings": { + "requestType": "UpdateSecuritySettingsRequest", + "responseType": "SecuritySettings", + "options": { + "(google.api.http).patch": "/v3beta1/{security_settings.name=projects/*/locations/*/securitySettings/*}", + "(google.api.http).body": "security_settings", + "(google.api.method_signature)": "security_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v3beta1/{security_settings.name=projects/*/locations/*/securitySettings/*}", + "body": "security_settings" + } + }, + { + "(google.api.method_signature)": "security_settings,update_mask" + } + ] + }, + "ListSecuritySettings": { + "requestType": "ListSecuritySettingsRequest", + "responseType": "ListSecuritySettingsResponse", + "options": { + "(google.api.http).get": "/v3beta1/{parent=projects/*/locations/*}/securitySettings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3beta1/{parent=projects/*/locations/*}/securitySettings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSecuritySettings": { + "requestType": "DeleteSecuritySettingsRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v3beta1/{name=projects/*/locations/*/securitySettings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetSecuritySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + } + } + }, + "UpdateSecuritySettingsRequest": { + "fields": { + "securitySettings": { + "type": "SecuritySettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSecuritySettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSecuritySettingsResponse": { + "fields": { + "securitySettings": { + "rule": "repeated", + "type": "SecuritySettings", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateSecuritySettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SecuritySettings" + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSecuritySettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SecuritySettings" + } + } + } + }, + "SecuritySettings": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SecuritySettings", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/securitySettings/{security_settings}" + }, + "oneofs": { + "dataRetention": { + "oneof": [ + "retentionWindowDays" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "redactionStrategy": { + "type": "RedactionStrategy", + "id": 3 + }, + "redactionScope": { + "type": "RedactionScope", + "id": 4 + }, + "inspectTemplate": { + "type": "string", + "id": 9 + }, + "retentionWindowDays": { + "type": "int32", + "id": 6 + }, + "purgeDataTypes": { + "rule": "repeated", + "type": "PurgeDataType", + "id": 8 + } + }, + "nested": { + "RedactionStrategy": { + "values": { + "REDACTION_STRATEGY_UNSPECIFIED": 0, + "REDACT_WITH_SERVICE": 1 + } + }, + "RedactionScope": { + "values": { + "REDACTION_SCOPE_UNSPECIFIED": 0, + "REDACT_DISK_STORAGE": 2 + } + }, + "PurgeDataType": { + "values": { + "PURGE_DATA_TYPE_UNSPECIFIED": 0, + "DIALOGFLOW_HISTORY": 1 + } } } }, diff --git a/src/v3beta1/agents_client.ts b/src/v3beta1/agents_client.ts index 157ca6f5..c1b48278 100644 --- a/src/v3beta1/agents_client.ts +++ b/src/v3beta1/agents_client.ts @@ -198,6 +198,9 @@ export class AgentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1959,6 +1962,65 @@ export class AgentsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/agents_proto_list.json b/src/v3beta1/agents_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/agents_proto_list.json +++ b/src/v3beta1/agents_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/entity_types_client.ts b/src/v3beta1/entity_types_client.ts index 4fff35a6..1130dd51 100644 --- a/src/v3beta1/entity_types_client.ts +++ b/src/v3beta1/entity_types_client.ts @@ -196,6 +196,9 @@ export class EntityTypesClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1725,6 +1728,65 @@ export class EntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/entity_types_proto_list.json b/src/v3beta1/entity_types_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/entity_types_proto_list.json +++ b/src/v3beta1/entity_types_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/environments_client.ts b/src/v3beta1/environments_client.ts index 9ff6147d..17e07294 100644 --- a/src/v3beta1/environments_client.ts +++ b/src/v3beta1/environments_client.ts @@ -198,6 +198,9 @@ export class EnvironmentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1986,6 +1989,65 @@ export class EnvironmentsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/environments_proto_list.json b/src/v3beta1/environments_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/environments_proto_list.json +++ b/src/v3beta1/environments_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/flows_client.ts b/src/v3beta1/flows_client.ts index bc076e89..2c410a19 100644 --- a/src/v3beta1/flows_client.ts +++ b/src/v3beta1/flows_client.ts @@ -198,6 +198,9 @@ export class FlowsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1875,6 +1878,65 @@ export class FlowsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/flows_proto_list.json b/src/v3beta1/flows_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/flows_proto_list.json +++ b/src/v3beta1/flows_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/gapic_metadata.json b/src/v3beta1/gapic_metadata.json index b8561bf6..bb299b29 100644 --- a/src/v3beta1/gapic_metadata.json +++ b/src/v3beta1/gapic_metadata.json @@ -457,6 +457,74 @@ } } }, + "SecuritySettingsService": { + "clients": { + "grpc": { + "libraryClient": "SecuritySettingsServiceClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "createSecuritySettings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "getSecuritySettings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "updateSecuritySettings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "deleteSecuritySettings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "listSecuritySettings", + "listSecuritySettingsStream", + "listSecuritySettingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecuritySettingsServiceClient", + "rpcs": { + "CreateSecuritySettings": { + "methods": [ + "createSecuritySettings" + ] + }, + "GetSecuritySettings": { + "methods": [ + "getSecuritySettings" + ] + }, + "UpdateSecuritySettings": { + "methods": [ + "updateSecuritySettings" + ] + }, + "DeleteSecuritySettings": { + "methods": [ + "deleteSecuritySettings" + ] + }, + "ListSecuritySettings": { + "methods": [ + "listSecuritySettings", + "listSecuritySettingsStream", + "listSecuritySettingsAsync" + ] + } + } + } + } + }, "SessionEntityTypes": { "clients": { "grpc": { diff --git a/src/v3beta1/index.ts b/src/v3beta1/index.ts index c89332f2..4290247b 100644 --- a/src/v3beta1/index.ts +++ b/src/v3beta1/index.ts @@ -22,6 +22,7 @@ export {EnvironmentsClient} from './environments_client'; export {FlowsClient} from './flows_client'; export {IntentsClient} from './intents_client'; export {PagesClient} from './pages_client'; +export {SecuritySettingsServiceClient} from './security_settings_service_client'; export {SessionEntityTypesClient} from './session_entity_types_client'; export {SessionsClient} from './sessions_client'; export {TransitionRouteGroupsClient} from './transition_route_groups_client'; diff --git a/src/v3beta1/intents_client.ts b/src/v3beta1/intents_client.ts index aa140d59..b00032bf 100644 --- a/src/v3beta1/intents_client.ts +++ b/src/v3beta1/intents_client.ts @@ -196,6 +196,9 @@ export class IntentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1703,6 +1706,65 @@ export class IntentsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/intents_proto_list.json b/src/v3beta1/intents_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/intents_proto_list.json +++ b/src/v3beta1/intents_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/pages_client.ts b/src/v3beta1/pages_client.ts index 48d838eb..62a0c4b4 100644 --- a/src/v3beta1/pages_client.ts +++ b/src/v3beta1/pages_client.ts @@ -196,6 +196,9 @@ export class PagesClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1724,6 +1727,65 @@ export class PagesClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/pages_proto_list.json b/src/v3beta1/pages_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/pages_proto_list.json +++ b/src/v3beta1/pages_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/security_settings_service_client.ts b/src/v3beta1/security_settings_service_client.ts new file mode 100644 index 00000000..435098ed --- /dev/null +++ b/src/v3beta1/security_settings_service_client.ts @@ -0,0 +1,1977 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v3beta1/security_settings_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_settings_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing security settings for Dialogflow. + * @class + * @memberof v3beta1 + */ +export class SecuritySettingsServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + securitySettingsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecuritySettingsServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof SecuritySettingsServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}' + ), + flowPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/intents/{intent}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + pagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAgentEnvironmentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}' + ), + projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' + ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), + transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' + ), + versionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}' + ), + webhookPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSecuritySettings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'securitySettings' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.securitySettingsServiceStub) { + return this.securitySettingsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService. + this.securitySettingsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.cx.v3beta1 + .SecuritySettingsService, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const securitySettingsServiceStubMethods = [ + 'createSecuritySettings', + 'getSecuritySettings', + 'updateSecuritySettings', + 'listSecuritySettings', + 'deleteSecuritySettings', + ]; + for (const methodName of securitySettingsServiceStubMethods) { + const callPromise = this.securitySettingsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.securitySettingsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + >; + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Create security settings in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to create an {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings} for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} request.securitySettings + * Required. The security settings to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecuritySettings]{@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createSecuritySettings(request); + */ + createSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.ICreateSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createSecuritySettings( + request, + options, + callback + ); + } + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + >; + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * The returned settings may be stale by up to 1 minute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the settings. + * Format: `projects//locations//securitySettings/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecuritySettings]{@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getSecuritySettings(request); + */ + getSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IGetSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getSecuritySettings(request, options, callback); + } + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + >; + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + callback: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.cx.v3beta1.SecuritySettings} request.securitySettings + * Required. [SecuritySettings] object that contains values for each of the + * fields to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecuritySettings]{@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateSecuritySettings(request); + */ + updateSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IUpdateSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'security_settings.name': request.securitySettings!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateSecuritySettings( + request, + options, + callback + ); + } + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + >; + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the {@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings|SecuritySettings} to delete. + * Format: `projects//locations//securitySettings/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteSecuritySettings(request); + */ + deleteSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.cx.v3beta1.IDeleteSecuritySettingsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSecuritySettings( + request, + options, + callback + ); + } + + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + ] + >; + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + > + ): void; + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + > + ): void; + /** + * Returns the list of all security settings in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [SecuritySettings]{@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSecuritySettingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSecuritySettings( + request: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + | protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings + > + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[], + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest | null, + protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listSecuritySettings(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [SecuritySettings]{@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSecuritySettingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSecuritySettingsStream( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSecuritySettings.createStream( + this.innerApiCalls.listSecuritySettings as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSecuritySettings`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list all security settings for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 20 and + * at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [SecuritySettings]{@link google.cloud.dialogflow.cx.v3beta1.SecuritySettings}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listSecuritySettingsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listSecuritySettingsAsync( + request?: protos.google.cloud.dialogflow.cx.v3beta1.IListSecuritySettingsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSecuritySettings.asyncIterate( + this.innerApiCalls['listSecuritySettings'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @returns {string} Resource name string. + */ + agentPath(project: string, location: string, agent: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + location: location, + agent: agent, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Parse the location from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).location; + } + + /** + * Parse the agent from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).agent; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + agent: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + agent: agent, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the agent from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .agent; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath( + project: string, + location: string, + agent: string, + environment: string + ) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .location; + } + + /** + * Parse the agent from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .agent; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified flow resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @returns {string} Resource name string. + */ + flowPath(project: string, location: string, agent: string, flow: string) { + return this.pathTemplates.flowPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + }); + } + + /** + * Parse the project from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).project; + } + + /** + * Parse the location from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).location; + } + + /** + * Parse the agent from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).agent; + } + + /** + * Parse the flow from Flow resource. + * + * @param {string} flowName + * A fully-qualified path representing Flow resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromFlowName(flowName: string) { + return this.pathTemplates.flowPathTemplate.match(flowName).flow; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, location: string, agent: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + location: location, + agent: agent, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the location from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).location; + } + + /** + * Parse the agent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).agent; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified page resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} page + * @returns {string} Resource name string. + */ + pagePath( + project: string, + location: string, + agent: string, + flow: string, + page: string + ) { + return this.pathTemplates.pagePathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + page: page, + }); + } + + /** + * Parse the project from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).project; + } + + /** + * Parse the location from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).location; + } + + /** + * Parse the agent from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).agent; + } + + /** + * Parse the flow from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).flow; + } + + /** + * Parse the page from Page resource. + * + * @param {string} pageName + * A fully-qualified path representing Page resource. + * @returns {string} A string representing the page. + */ + matchPageFromPageName(pageName: string) { + return this.pathTemplates.pagePathTemplate.match(pageName).page; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironmentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentSessionEntityTypePath( + project: string, + location: string, + agent: string, + environment: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + environment: environment, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName + ).agent; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName + ).environment; + } + + /** + * Parse the session from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentEnvironmentSessionEntityType resource. + * + * @param {string} projectLocationAgentEnvironmentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_environment_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + projectLocationAgentEnvironmentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match( + projectLocationAgentEnvironmentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + agent: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + agent: agent, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).location; + } + + /** + * Parse the agent from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).agent; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + + /** + * Return a fully-qualified transitionRouteGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} transition_route_group + * @returns {string} Resource name string. + */ + transitionRouteGroupPath( + project: string, + location: string, + agent: string, + flow: string, + transitionRouteGroup: string + ) { + return this.pathTemplates.transitionRouteGroupPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + transition_route_group: transitionRouteGroup, + }); + } + + /** + * Parse the project from TransitionRouteGroup resource. + * + * @param {string} transitionRouteGroupName + * A fully-qualified path representing TransitionRouteGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTransitionRouteGroupName(transitionRouteGroupName: string) { + return this.pathTemplates.transitionRouteGroupPathTemplate.match( + transitionRouteGroupName + ).project; + } + + /** + * Parse the location from TransitionRouteGroup resource. + * + * @param {string} transitionRouteGroupName + * A fully-qualified path representing TransitionRouteGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTransitionRouteGroupName(transitionRouteGroupName: string) { + return this.pathTemplates.transitionRouteGroupPathTemplate.match( + transitionRouteGroupName + ).location; + } + + /** + * Parse the agent from TransitionRouteGroup resource. + * + * @param {string} transitionRouteGroupName + * A fully-qualified path representing TransitionRouteGroup resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromTransitionRouteGroupName(transitionRouteGroupName: string) { + return this.pathTemplates.transitionRouteGroupPathTemplate.match( + transitionRouteGroupName + ).agent; + } + + /** + * Parse the flow from TransitionRouteGroup resource. + * + * @param {string} transitionRouteGroupName + * A fully-qualified path representing TransitionRouteGroup resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromTransitionRouteGroupName(transitionRouteGroupName: string) { + return this.pathTemplates.transitionRouteGroupPathTemplate.match( + transitionRouteGroupName + ).flow; + } + + /** + * Parse the transition_route_group from TransitionRouteGroup resource. + * + * @param {string} transitionRouteGroupName + * A fully-qualified path representing TransitionRouteGroup resource. + * @returns {string} A string representing the transition_route_group. + */ + matchTransitionRouteGroupFromTransitionRouteGroupName( + transitionRouteGroupName: string + ) { + return this.pathTemplates.transitionRouteGroupPathTemplate.match( + transitionRouteGroupName + ).transition_route_group; + } + + /** + * Return a fully-qualified version resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} flow + * @param {string} version + * @returns {string} Resource name string. + */ + versionPath( + project: string, + location: string, + agent: string, + flow: string, + version: string + ) { + return this.pathTemplates.versionPathTemplate.render({ + project: project, + location: location, + agent: agent, + flow: flow, + version: version, + }); + } + + /** + * Parse the project from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).project; + } + + /** + * Parse the location from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).location; + } + + /** + * Parse the agent from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).agent; + } + + /** + * Parse the flow from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the flow. + */ + matchFlowFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).flow; + } + + /** + * Parse the version from Version resource. + * + * @param {string} versionName + * A fully-qualified path representing Version resource. + * @returns {string} A string representing the version. + */ + matchVersionFromVersionName(versionName: string) { + return this.pathTemplates.versionPathTemplate.match(versionName).version; + } + + /** + * Return a fully-qualified webhook resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} webhook + * @returns {string} Resource name string. + */ + webhookPath( + project: string, + location: string, + agent: string, + webhook: string + ) { + return this.pathTemplates.webhookPathTemplate.render({ + project: project, + location: location, + agent: agent, + webhook: webhook, + }); + } + + /** + * Parse the project from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).project; + } + + /** + * Parse the location from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).location; + } + + /** + * Parse the agent from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).agent; + } + + /** + * Parse the webhook from Webhook resource. + * + * @param {string} webhookName + * A fully-qualified path representing Webhook resource. + * @returns {string} A string representing the webhook. + */ + matchWebhookFromWebhookName(webhookName: string) { + return this.pathTemplates.webhookPathTemplate.match(webhookName).webhook; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.securitySettingsServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3beta1/security_settings_service_client_config.json b/src/v3beta1/security_settings_service_client_config.json new file mode 100644 index 00000000..4227b7ab --- /dev/null +++ b/src/v3beta1/security_settings_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteSecuritySettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v3beta1/security_settings_service_proto_list.json b/src/v3beta1/security_settings_service_proto_list.json new file mode 100644 index 00000000..6e6cffbd --- /dev/null +++ b/src/v3beta1/security_settings_service_proto_list.json @@ -0,0 +1,17 @@ +[ + "../../protos/google/cloud/dialogflow/cx/v3beta1/agent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/environment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/flow.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/fulfillment.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/version.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/webhook.proto" +] diff --git a/src/v3beta1/session_entity_types_client.ts b/src/v3beta1/session_entity_types_client.ts index aadc0f6c..1eaa7109 100644 --- a/src/v3beta1/session_entity_types_client.ts +++ b/src/v3beta1/session_entity_types_client.ts @@ -199,6 +199,9 @@ export class SessionEntityTypesClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1774,6 +1777,65 @@ export class SessionEntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/session_entity_types_proto_list.json b/src/v3beta1/session_entity_types_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/session_entity_types_proto_list.json +++ b/src/v3beta1/session_entity_types_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/sessions_client.ts b/src/v3beta1/sessions_client.ts index d7cb9fee..3dca6cfc 100644 --- a/src/v3beta1/sessions_client.ts +++ b/src/v3beta1/sessions_client.ts @@ -189,6 +189,9 @@ export class SessionsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1522,6 +1525,65 @@ export class SessionsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/sessions_proto_list.json b/src/v3beta1/sessions_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/sessions_proto_list.json +++ b/src/v3beta1/sessions_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/transition_route_groups_client.ts b/src/v3beta1/transition_route_groups_client.ts index a99d8708..df76f14d 100644 --- a/src/v3beta1/transition_route_groups_client.ts +++ b/src/v3beta1/transition_route_groups_client.ts @@ -197,6 +197,9 @@ export class TransitionRouteGroupsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1732,6 +1735,65 @@ export class TransitionRouteGroupsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/transition_route_groups_proto_list.json b/src/v3beta1/transition_route_groups_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/transition_route_groups_proto_list.json +++ b/src/v3beta1/transition_route_groups_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/versions_client.ts b/src/v3beta1/versions_client.ts index 2f2e2785..40b6420d 100644 --- a/src/v3beta1/versions_client.ts +++ b/src/v3beta1/versions_client.ts @@ -198,6 +198,9 @@ export class VersionsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1875,6 +1878,65 @@ export class VersionsClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/versions_proto_list.json b/src/v3beta1/versions_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/versions_proto_list.json +++ b/src/v3beta1/versions_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/src/v3beta1/webhooks_client.ts b/src/v3beta1/webhooks_client.ts index beabc7ec..9b5a3959 100644 --- a/src/v3beta1/webhooks_client.ts +++ b/src/v3beta1/webhooks_client.ts @@ -202,6 +202,9 @@ export class WebhooksClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}' ), + securitySettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securitySettings/{security_settings}' + ), transitionRouteGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}' ), @@ -1835,6 +1838,65 @@ export class WebhooksClient { ).entity_type; } + /** + * Return a fully-qualified securitySettings resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_settings + * @returns {string} Resource name string. + */ + securitySettingsPath( + project: string, + location: string, + securitySettings: string + ) { + return this.pathTemplates.securitySettingsPathTemplate.render({ + project: project, + location: location, + security_settings: securitySettings, + }); + } + + /** + * Parse the project from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).project; + } + + /** + * Parse the location from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).location; + } + + /** + * Parse the security_settings from SecuritySettings resource. + * + * @param {string} securitySettingsName + * A fully-qualified path representing SecuritySettings resource. + * @returns {string} A string representing the security_settings. + */ + matchSecuritySettingsFromSecuritySettingsName(securitySettingsName: string) { + return this.pathTemplates.securitySettingsPathTemplate.match( + securitySettingsName + ).security_settings; + } + /** * Return a fully-qualified transitionRouteGroup resource name string. * diff --git a/src/v3beta1/webhooks_proto_list.json b/src/v3beta1/webhooks_proto_list.json index c39c02a6..6e6cffbd 100644 --- a/src/v3beta1/webhooks_proto_list.json +++ b/src/v3beta1/webhooks_proto_list.json @@ -8,6 +8,7 @@ "../../protos/google/cloud/dialogflow/cx/v3beta1/intent.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/page.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/response_message.proto", + "../../protos/google/cloud/dialogflow/cx/v3beta1/security_settings.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto", diff --git a/synth.metadata b/synth.metadata index e9b725f4..03225460 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e4d01555afeb93d2f3b467056ea884b092567d1b", - "internalRef": "346434847" + "sha": "fb36278c9343b7933fed2f19de153797ac27d8f2", + "internalRef": "348481983" } }, { diff --git a/test/gapic_agents_v3beta1.ts b/test/gapic_agents_v3beta1.ts index ee48aec3..fc017f92 100644 --- a/test/gapic_agents_v3beta1.ts +++ b/test/gapic_agents_v3beta1.ts @@ -2149,6 +2149,73 @@ describe('v3beta1.AgentsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new agentsModule.v3beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_entity_types_v3beta1.ts b/test/gapic_entity_types_v3beta1.ts index a3ae77ee..f64ca73b 100644 --- a/test/gapic_entity_types_v3beta1.ts +++ b/test/gapic_entity_types_v3beta1.ts @@ -1742,6 +1742,73 @@ describe('v3beta1.EntityTypesClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new entitytypesModule.v3beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_environments_v3beta1.ts b/test/gapic_environments_v3beta1.ts index 8ac669d8..46124439 100644 --- a/test/gapic_environments_v3beta1.ts +++ b/test/gapic_environments_v3beta1.ts @@ -2268,6 +2268,73 @@ describe('v3beta1.EnvironmentsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new environmentsModule.v3beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_flows_v3beta1.ts b/test/gapic_flows_v3beta1.ts index 7b44f86e..410d5a49 100644 --- a/test/gapic_flows_v3beta1.ts +++ b/test/gapic_flows_v3beta1.ts @@ -1949,6 +1949,73 @@ describe('v3beta1.FlowsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new flowsModule.v3beta1.FlowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_intents_v3beta1.ts b/test/gapic_intents_v3beta1.ts index ef887972..1b860050 100644 --- a/test/gapic_intents_v3beta1.ts +++ b/test/gapic_intents_v3beta1.ts @@ -1735,6 +1735,73 @@ describe('v3beta1.IntentsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new intentsModule.v3beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_pages_v3beta1.ts b/test/gapic_pages_v3beta1.ts index f73bca24..2194b371 100644 --- a/test/gapic_pages_v3beta1.ts +++ b/test/gapic_pages_v3beta1.ts @@ -1726,6 +1726,73 @@ describe('v3beta1.PagesClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new pagesModule.v3beta1.PagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_security_settings_service_v3beta1.ts b/test/gapic_security_settings_service_v3beta1.ts new file mode 100644 index 00000000..b5b4dd80 --- /dev/null +++ b/test/gapic_security_settings_service_v3beta1.ts @@ -0,0 +1,2180 @@ +// 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as securitysettingsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v3beta1.SecuritySettingsServiceClient', () => { + it('has servicePath', () => { + const servicePath = + securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.securitySettingsServiceStub, undefined); + await client.initialize(); + assert(client.securitySettingsServiceStub); + }); + + it('has close method', () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createSecuritySettings', () => { + it('invokes createSecuritySettings without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ); + client.innerApiCalls.createSecuritySettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSecuritySettings without error using callback', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ); + client.innerApiCalls.createSecuritySettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSecuritySettings with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.CreateSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecuritySettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createSecuritySettings(request), + expectedError + ); + assert( + (client.innerApiCalls.createSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSecuritySettings', () => { + it('invokes getSecuritySettings without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ); + client.innerApiCalls.getSecuritySettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSecuritySettings without error using callback', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ); + client.innerApiCalls.getSecuritySettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSecuritySettings with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.GetSecuritySettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecuritySettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSecuritySettings(request), expectedError); + assert( + (client.innerApiCalls.getSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateSecuritySettings', () => { + it('invokes updateSecuritySettings without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest() + ); + request.securitySettings = {}; + request.securitySettings.name = ''; + const expectedHeaderRequestParams = 'security_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ); + client.innerApiCalls.updateSecuritySettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateSecuritySettings without error using callback', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest() + ); + request.securitySettings = {}; + request.securitySettings.name = ''; + const expectedHeaderRequestParams = 'security_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ); + client.innerApiCalls.updateSecuritySettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateSecuritySettings with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.UpdateSecuritySettingsRequest() + ); + request.securitySettings = {}; + request.securitySettings.name = ''; + const expectedHeaderRequestParams = 'security_settings.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecuritySettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateSecuritySettings(request), + expectedError + ); + assert( + (client.innerApiCalls.updateSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteSecuritySettings', () => { + it('invokes deleteSecuritySettings without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSecuritySettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSecuritySettings without error using callback', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSecuritySettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteSecuritySettings( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSecuritySettings with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.DeleteSecuritySettingsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecuritySettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteSecuritySettings(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listSecuritySettings', () => { + it('invokes listSecuritySettings without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + ]; + client.innerApiCalls.listSecuritySettings = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listSecuritySettings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSecuritySettings without error using callback', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + ]; + client.innerApiCalls.listSecuritySettings = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSecuritySettings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSecuritySettings with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecuritySettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSecuritySettings(request), expectedError); + assert( + (client.innerApiCalls.listSecuritySettings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSecuritySettingsStream without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + ]; + client.descriptors.page.listSecuritySettings.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSecuritySettingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecuritySettings, request) + ); + assert.strictEqual( + (client.descriptors.page.listSecuritySettings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listSecuritySettingsStream with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSecuritySettings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSecuritySettingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSecuritySettings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSecuritySettings, request) + ); + assert.strictEqual( + (client.descriptors.page.listSecuritySettings + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSecuritySettings without error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.SecuritySettings() + ), + ]; + client.descriptors.page.listSecuritySettings.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[] = []; + const iterable = client.listSecuritySettingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSecuritySettings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSecuritySettings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSecuritySettings with error', async () => { + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3beta1.ListSecuritySettingsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSecuritySettings.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSecuritySettingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3beta1.ISecuritySettings[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSecuritySettings + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSecuritySettings + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath( + 'projectValue', + 'locationValue', + 'agentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAgentName', () => { + const result = client.matchLocationFromAgentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromAgentName', () => { + const result = client.matchAgentFromAgentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + entity_type: 'entityTypeValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromEntityTypeName', () => { + const result = client.matchAgentFromEntityTypeName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromEnvironmentName', () => { + const result = client.matchAgentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('flow', () => { + const fakePath = '/rendered/path/flow'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.flowPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.flowPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('flowPath', () => { + const result = client.flowPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.flowPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFlowName', () => { + const result = client.matchProjectFromFlowName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFlowName', () => { + const result = client.matchLocationFromFlowName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromFlowName', () => { + const result = client.matchAgentFromFlowName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFlowFromFlowName', () => { + const result = client.matchFlowFromFlowName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.flowPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + intent: 'intentValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIntentName', () => { + const result = client.matchLocationFromIntentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromIntentName', () => { + const result = client.matchAgentFromIntentName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('page', () => { + const fakePath = '/rendered/path/page'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + page: 'pageValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.pagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pagePath', () => { + const result = client.pagePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'pageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pagePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPageName', () => { + const result = client.matchProjectFromPageName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPageName', () => { + const result = client.matchLocationFromPageName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromPageName', () => { + const result = client.matchAgentFromPageName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFlowFromPageName', () => { + const result = client.matchFlowFromPageName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPageFromPageName', () => { + const result = client.matchPageFromPageName(fakePath); + assert.strictEqual(result, 'pageValue'); + assert( + (client.pathTemplates.pagePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironmentSessionEntityType', () => { + const fakePath = + '/rendered/path/projectLocationAgentEnvironmentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEnvironmentSessionEntityTypePath', () => { + const result = client.projectLocationAgentEnvironmentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = client.matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentEnvironmentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'agentValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchAgentFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('transitionRouteGroup', () => { + const fakePath = '/rendered/path/transitionRouteGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + transition_route_group: 'transitionRouteGroupValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.transitionRouteGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.transitionRouteGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('transitionRouteGroupPath', () => { + const result = client.transitionRouteGroupPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'transitionRouteGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.transitionRouteGroupPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTransitionRouteGroupName', () => { + const result = client.matchProjectFromTransitionRouteGroupName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.transitionRouteGroupPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTransitionRouteGroupName', () => { + const result = client.matchLocationFromTransitionRouteGroupName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.transitionRouteGroupPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromTransitionRouteGroupName', () => { + const result = client.matchAgentFromTransitionRouteGroupName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.transitionRouteGroupPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFlowFromTransitionRouteGroupName', () => { + const result = client.matchFlowFromTransitionRouteGroupName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.transitionRouteGroupPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTransitionRouteGroupFromTransitionRouteGroupName', () => { + const result = client.matchTransitionRouteGroupFromTransitionRouteGroupName( + fakePath + ); + assert.strictEqual(result, 'transitionRouteGroupValue'); + assert( + (client.pathTemplates.transitionRouteGroupPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('version', () => { + const fakePath = '/rendered/path/version'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + flow: 'flowValue', + version: 'versionValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.versionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.versionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('versionPath', () => { + const result = client.versionPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'flowValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.versionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVersionName', () => { + const result = client.matchProjectFromVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVersionName', () => { + const result = client.matchLocationFromVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromVersionName', () => { + const result = client.matchAgentFromVersionName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFlowFromVersionName', () => { + const result = client.matchFlowFromVersionName(fakePath); + assert.strictEqual(result, 'flowValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromVersionName', () => { + const result = client.matchVersionFromVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.versionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('webhook', () => { + const fakePath = '/rendered/path/webhook'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + webhook: 'webhookValue', + }; + const client = new securitysettingsserviceModule.v3beta1.SecuritySettingsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.webhookPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.webhookPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('webhookPath', () => { + const result = client.webhookPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'webhookValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.webhookPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWebhookName', () => { + const result = client.matchProjectFromWebhookName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWebhookName', () => { + const result = client.matchLocationFromWebhookName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromWebhookName', () => { + const result = client.matchAgentFromWebhookName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWebhookFromWebhookName', () => { + const result = client.matchWebhookFromWebhookName(fakePath); + assert.strictEqual(result, 'webhookValue'); + assert( + (client.pathTemplates.webhookPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/test/gapic_session_entity_types_v3beta1.ts b/test/gapic_session_entity_types_v3beta1.ts index 26c8a534..5673bede 100644 --- a/test/gapic_session_entity_types_v3beta1.ts +++ b/test/gapic_session_entity_types_v3beta1.ts @@ -1931,6 +1931,75 @@ describe('v3beta1.SessionEntityTypesClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new sessionentitytypesModule.v3beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_sessions_v3beta1.ts b/test/gapic_sessions_v3beta1.ts index 27746fd0..a3b89a7e 100644 --- a/test/gapic_sessions_v3beta1.ts +++ b/test/gapic_sessions_v3beta1.ts @@ -1471,6 +1471,73 @@ describe('v3beta1.SessionsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new sessionsModule.v3beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_transition_route_groups_v3beta1.ts b/test/gapic_transition_route_groups_v3beta1.ts index 326738c6..fc74682c 100644 --- a/test/gapic_transition_route_groups_v3beta1.ts +++ b/test/gapic_transition_route_groups_v3beta1.ts @@ -1846,6 +1846,75 @@ describe('v3beta1.TransitionRouteGroupsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new transitionroutegroupsModule.v3beta1.TransitionRouteGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_versions_v3beta1.ts b/test/gapic_versions_v3beta1.ts index abc94aa8..c14662af 100644 --- a/test/gapic_versions_v3beta1.ts +++ b/test/gapic_versions_v3beta1.ts @@ -2047,6 +2047,73 @@ describe('v3beta1.VersionsClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new versionsModule.v3beta1.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = { diff --git a/test/gapic_webhooks_v3beta1.ts b/test/gapic_webhooks_v3beta1.ts index 658d6746..61b02b6a 100644 --- a/test/gapic_webhooks_v3beta1.ts +++ b/test/gapic_webhooks_v3beta1.ts @@ -1939,6 +1939,73 @@ describe('v3beta1.WebhooksClient', () => { }); }); + describe('securitySettings', () => { + const fakePath = '/rendered/path/securitySettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + security_settings: 'securitySettingsValue', + }; + const client = new webhooksModule.v3beta1.WebhooksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.securitySettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.securitySettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('securitySettingsPath', () => { + const result = client.securitySettingsPath( + 'projectValue', + 'locationValue', + 'securitySettingsValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.securitySettingsPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecuritySettingsName', () => { + const result = client.matchProjectFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSecuritySettingsName', () => { + const result = client.matchLocationFromSecuritySettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecuritySettingsFromSecuritySettingsName', () => { + const result = client.matchSecuritySettingsFromSecuritySettingsName( + fakePath + ); + assert.strictEqual(result, 'securitySettingsValue'); + assert( + (client.pathTemplates.securitySettingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('transitionRouteGroup', () => { const fakePath = '/rendered/path/transitionRouteGroup'; const expectedParameters = {