From 248ae742e786dd24f8a0e8161a1a30f684c3b7ff Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 21:12:06 +0000 Subject: [PATCH] feat: added API for running continuous test (#123) PiperOrigin-RevId: 375809988 Source-Link: https://github.com/googleapis/googleapis/commit/b2c4b3d62150a73507cbd3aa816fc0f177873556 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5cbab19f7df19eb09fc358d7171dab1d01fcb784 --- .../cloud/dialogflow/cx/v3/audio_config.proto | 50 +- .../cloud/dialogflow/cx/v3/environment.proto | 113 ++ protos/protos.d.ts | 652 +++++++- protos/protos.js | 1478 ++++++++++++++++- protos/protos.json | 165 +- src/v3/agents_client.ts | 98 ++ src/v3/entity_types_client.ts | 98 ++ src/v3/environments_client.ts | 462 ++++++ src/v3/environments_client_config.json | 10 + src/v3/experiments_client.ts | 98 ++ src/v3/flows_client.ts | 98 ++ src/v3/gapic_metadata.json | 24 + src/v3/intents_client.ts | 98 ++ src/v3/pages_client.ts | 98 ++ src/v3/security_settings_service_client.ts | 98 ++ src/v3/session_entity_types_client.ts | 98 ++ src/v3/sessions_client.ts | 98 ++ src/v3/test_cases_client.ts | 98 ++ src/v3/transition_route_groups_client.ts | 98 ++ src/v3/versions_client.ts | 98 ++ src/v3/webhooks_client.ts | 98 ++ test/gapic_agents_v3.ts | 112 ++ test/gapic_entity_types_v3.ts | 112 ++ test/gapic_environments_v3.ts | 637 +++++++ test/gapic_experiments_v3.ts | 112 ++ test/gapic_flows_v3.ts | 112 ++ test/gapic_intents_v3.ts | 112 ++ test/gapic_pages_v3.ts | 112 ++ test/gapic_security_settings_service_v3.ts | 113 ++ test/gapic_session_entity_types_v3.ts | 112 ++ test/gapic_sessions_v3.ts | 112 ++ test/gapic_test_cases_v3.ts | 112 ++ test/gapic_transition_route_groups_v3.ts | 113 ++ test/gapic_versions_v3.ts | 112 ++ test/gapic_webhooks_v3.ts | 112 ++ 35 files changed, 6248 insertions(+), 75 deletions(-) diff --git a/protos/google/cloud/dialogflow/cx/v3/audio_config.proto b/protos/google/cloud/dialogflow/cx/v3/audio_config.proto index dc9c911b..e444bbe6 100644 --- a/protos/google/cloud/dialogflow/cx/v3/audio_config.proto +++ b/protos/google/cloud/dialogflow/cx/v3/audio_config.proto @@ -29,31 +29,6 @@ option java_outer_classname = "AudioConfigProto"; option java_package = "com.google.cloud.dialogflow.cx.v3"; option objc_class_prefix = "DF"; -// Information for a word recognized by the speech recognizer. -message SpeechWordInfo { - // The word this info is for. - string word = 3; - - // Time offset relative to the beginning of the audio that corresponds to the - // start of the spoken word. This is an experimental feature and the accuracy - // of the time offset can vary. - google.protobuf.Duration start_offset = 1; - - // Time offset relative to the beginning of the audio that corresponds to the - // end of the spoken word. This is an experimental feature and the accuracy of - // the time offset can vary. - google.protobuf.Duration end_offset = 2; - - // The Speech confidence between 0.0 and 1.0 for this word. A higher number - // indicates an estimated greater likelihood that the recognized word is - // correct. The default of 0.0 is a sentinel value indicating that confidence - // was not set. - // - // This field is not guaranteed to be fully stable over time for the same - // audio input. Users should also not rely on it to always be provided. - float confidence = 4; -} - // Audio encoding of the audio content sent in the conversational query request. // Refer to the // [Cloud Speech API @@ -103,6 +78,31 @@ enum AudioEncoding { AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; } +// Information for a word recognized by the speech recognizer. +message SpeechWordInfo { + // The word this info is for. + string word = 3; + + // Time offset relative to the beginning of the audio that corresponds to the + // start of the spoken word. This is an experimental feature and the accuracy + // of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio that corresponds to the + // end of the spoken word. This is an experimental feature and the accuracy of + // the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The Speech confidence between 0.0 and 1.0 for this word. A higher number + // indicates an estimated greater likelihood that the recognized word is + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. + // + // This field is not guaranteed to be fully stable over time for the same + // audio input. Users should also not rely on it to always be provided. + float confidence = 4; +} + // Instructs the speech recognizer on how to process the audio content. message InputAudioConfig { // Required. Audio encoding of the audio content to process. diff --git a/protos/google/cloud/dialogflow/cx/v3/environment.proto b/protos/google/cloud/dialogflow/cx/v3/environment.proto index a1ac901e..b5670def 100644 --- a/protos/google/cloud/dialogflow/cx/v3/environment.proto +++ b/protos/google/cloud/dialogflow/cx/v3/environment.proto @@ -98,6 +98,26 @@ service Environments { }; option (google.api.method_signature) = "name"; } + + // Kicks off a continuous test under the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. + rpc RunContinuousTest(RunContinuousTestRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RunContinuousTestResponse" + metadata_type: "RunContinuousTestMetadata" + }; + } + + // Fetches a list of continuous test results for a given environment. + rpc ListContinuousTestResults(ListContinuousTestResultsRequest) returns (ListContinuousTestResultsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults" + }; + option (google.api.method_signature) = "parent"; + } } // Represents an environment for an agent. You can create multiple versions @@ -261,3 +281,96 @@ message LookupEnvironmentHistoryResponse { // results in the list. string next_page_token = 2; } + +// Represents a result from running a test case in an agent environment. +message ContinuousTestResult { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ContinuousTestResult" + pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}" + }; + + // The overall result for a continuous test run in an agent environment. + enum AggregatedTestResult { + // Not specified. Should never be used. + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0; + + // All the tests passed. + PASSED = 1; + + // At least one test did not pass. + FAILED = 2; + } + + // The resource name for the continuous test result. Format: + // `projects//locations//agents//environments//continuousTestResults/`. + string name = 1; + + // The result of this continuous test run, i.e. whether all the tests in this + // continuous test run pass or not. + AggregatedTestResult result = 2; + + // A list of individual test case results names in this continuous test run. + repeated string test_case_results = 3 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/TestCaseResult" + }]; + + // Time when the continuous testing run starts. + google.protobuf.Timestamp run_time = 4; +} + +// The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest]. +message RunContinuousTestRequest { + // Required. Format: `projects//locations//agents//environments/`. + string environment = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Environment" + } + ]; +} + +// The response message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest]. +message RunContinuousTestResponse { + // The result for a continuous test run. + ContinuousTestResult continuous_test_result = 1; +} + +// Metadata returned for the [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest] long running +// operation. +message RunContinuousTestMetadata { + // The test errors. + repeated TestError errors = 1; +} + +// The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults]. +message ListContinuousTestResultsRequest { + // Required. The environment to list results for. + // Format: `projects//locations//agents// + // environments/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ContinuousTestResult" + } + ]; + + // The maximum number of items to return in a single page. By default 100 and + // at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Environments.ListTestCaseResults][]. +message ListContinuousTestResultsResponse { + // The list of continuous test results. + repeated ContinuousTestResult continuous_test_results = 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; +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index bce14dbd..34a118d3 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -7445,6 +7445,18 @@ export namespace google { } } + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + AUDIO_ENCODING_LINEAR_16 = 1, + AUDIO_ENCODING_FLAC = 2, + AUDIO_ENCODING_MULAW = 3, + AUDIO_ENCODING_AMR = 4, + AUDIO_ENCODING_AMR_WB = 5, + AUDIO_ENCODING_OGG_OPUS = 6, + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + } + /** Properties of a SpeechWordInfo. */ interface ISpeechWordInfo { @@ -7553,18 +7565,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** AudioEncoding enum. */ - enum AudioEncoding { - AUDIO_ENCODING_UNSPECIFIED = 0, - AUDIO_ENCODING_LINEAR_16 = 1, - AUDIO_ENCODING_FLAC = 2, - AUDIO_ENCODING_MULAW = 3, - AUDIO_ENCODING_AMR = 4, - AUDIO_ENCODING_AMR_WB = 5, - AUDIO_ENCODING_OGG_OPUS = 6, - AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 - } - /** Properties of an InputAudioConfig. */ interface IInputAudioConfig { @@ -9196,6 +9196,34 @@ export namespace google { * @returns Promise */ public lookupEnvironmentHistory(request: google.cloud.dialogflow.cx.v3.ILookupEnvironmentHistoryRequest): Promise; + + /** + * Calls RunContinuousTest. + * @param request RunContinuousTestRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runContinuousTest(request: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, callback: google.cloud.dialogflow.cx.v3.Environments.RunContinuousTestCallback): void; + + /** + * Calls RunContinuousTest. + * @param request RunContinuousTestRequest message or plain object + * @returns Promise + */ + public runContinuousTest(request: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest): Promise; + + /** + * Calls ListContinuousTestResults. + * @param request ListContinuousTestResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContinuousTestResultsResponse + */ + public listContinuousTestResults(request: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, callback: google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResultsCallback): void; + + /** + * Calls ListContinuousTestResults. + * @param request ListContinuousTestResultsRequest message or plain object + * @returns Promise + */ + public listContinuousTestResults(request: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest): Promise; } namespace Environments { @@ -9241,6 +9269,20 @@ export namespace google { * @param [response] LookupEnvironmentHistoryResponse */ type LookupEnvironmentHistoryCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments#runContinuousTest}. + * @param error Error, if any + * @param [response] Operation + */ + type RunContinuousTestCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments#listContinuousTestResults}. + * @param error Error, if any + * @param [response] ListContinuousTestResultsResponse + */ + type ListContinuousTestResultsCallback = (error: (Error|null), response?: google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse) => void; } /** Properties of an Environment. */ @@ -10218,6 +10260,592 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ContinuousTestResult. */ + interface IContinuousTestResult { + + /** ContinuousTestResult name */ + name?: (string|null); + + /** ContinuousTestResult result */ + result?: (google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|keyof typeof google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|null); + + /** ContinuousTestResult testCaseResults */ + testCaseResults?: (string[]|null); + + /** ContinuousTestResult runTime */ + runTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ContinuousTestResult. */ + class ContinuousTestResult implements IContinuousTestResult { + + /** + * Constructs a new ContinuousTestResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IContinuousTestResult); + + /** ContinuousTestResult name. */ + public name: string; + + /** ContinuousTestResult result. */ + public result: (google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|keyof typeof google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult); + + /** ContinuousTestResult testCaseResults. */ + public testCaseResults: string[]; + + /** ContinuousTestResult runTime. */ + public runTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ContinuousTestResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ContinuousTestResult instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IContinuousTestResult): google.cloud.dialogflow.cx.v3.ContinuousTestResult; + + /** + * Encodes the specified ContinuousTestResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @param message ContinuousTestResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IContinuousTestResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContinuousTestResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @param message ContinuousTestResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IContinuousTestResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContinuousTestResult + * @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.v3.ContinuousTestResult; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContinuousTestResult + * @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.v3.ContinuousTestResult; + + /** + * Verifies a ContinuousTestResult 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 ContinuousTestResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContinuousTestResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ContinuousTestResult; + + /** + * Creates a plain object from a ContinuousTestResult message. Also converts values to other types if specified. + * @param message ContinuousTestResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ContinuousTestResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContinuousTestResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ContinuousTestResult { + + /** AggregatedTestResult enum. */ + enum AggregatedTestResult { + AGGREGATED_TEST_RESULT_UNSPECIFIED = 0, + PASSED = 1, + FAILED = 2 + } + } + + /** Properties of a RunContinuousTestRequest. */ + interface IRunContinuousTestRequest { + + /** RunContinuousTestRequest environment */ + environment?: (string|null); + } + + /** Represents a RunContinuousTestRequest. */ + class RunContinuousTestRequest implements IRunContinuousTestRequest { + + /** + * Constructs a new RunContinuousTestRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest); + + /** RunContinuousTestRequest environment. */ + public environment: string; + + /** + * Creates a new RunContinuousTestRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest): google.cloud.dialogflow.cx.v3.RunContinuousTestRequest; + + /** + * Encodes the specified RunContinuousTestRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @param message RunContinuousTestRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @param message RunContinuousTestRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestRequest + * @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.v3.RunContinuousTestRequest; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestRequest + * @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.v3.RunContinuousTestRequest; + + /** + * Verifies a RunContinuousTestRequest 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 RunContinuousTestRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunContinuousTestRequest; + + /** + * Creates a plain object from a RunContinuousTestRequest message. Also converts values to other types if specified. + * @param message RunContinuousTestRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunContinuousTestRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RunContinuousTestResponse. */ + interface IRunContinuousTestResponse { + + /** RunContinuousTestResponse continuousTestResult */ + continuousTestResult?: (google.cloud.dialogflow.cx.v3.IContinuousTestResult|null); + } + + /** Represents a RunContinuousTestResponse. */ + class RunContinuousTestResponse implements IRunContinuousTestResponse { + + /** + * Constructs a new RunContinuousTestResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse); + + /** RunContinuousTestResponse continuousTestResult. */ + public continuousTestResult?: (google.cloud.dialogflow.cx.v3.IContinuousTestResult|null); + + /** + * Creates a new RunContinuousTestResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse): google.cloud.dialogflow.cx.v3.RunContinuousTestResponse; + + /** + * Encodes the specified RunContinuousTestResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @param message RunContinuousTestResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @param message RunContinuousTestResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestResponse + * @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.v3.RunContinuousTestResponse; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestResponse + * @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.v3.RunContinuousTestResponse; + + /** + * Verifies a RunContinuousTestResponse 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 RunContinuousTestResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunContinuousTestResponse; + + /** + * Creates a plain object from a RunContinuousTestResponse message. Also converts values to other types if specified. + * @param message RunContinuousTestResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunContinuousTestResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RunContinuousTestMetadata. */ + interface IRunContinuousTestMetadata { + + /** RunContinuousTestMetadata errors */ + errors?: (google.cloud.dialogflow.cx.v3.ITestError[]|null); + } + + /** Represents a RunContinuousTestMetadata. */ + class RunContinuousTestMetadata implements IRunContinuousTestMetadata { + + /** + * Constructs a new RunContinuousTestMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata); + + /** RunContinuousTestMetadata errors. */ + public errors: google.cloud.dialogflow.cx.v3.ITestError[]; + + /** + * Creates a new RunContinuousTestMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RunContinuousTestMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata): google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata; + + /** + * Encodes the specified RunContinuousTestMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @param message RunContinuousTestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunContinuousTestMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @param message RunContinuousTestMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunContinuousTestMetadata + * @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.v3.RunContinuousTestMetadata; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunContinuousTestMetadata + * @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.v3.RunContinuousTestMetadata; + + /** + * Verifies a RunContinuousTestMetadata 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 RunContinuousTestMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunContinuousTestMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata; + + /** + * Creates a plain object from a RunContinuousTestMetadata message. Also converts values to other types if specified. + * @param message RunContinuousTestMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunContinuousTestMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListContinuousTestResultsRequest. */ + interface IListContinuousTestResultsRequest { + + /** ListContinuousTestResultsRequest parent */ + parent?: (string|null); + + /** ListContinuousTestResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListContinuousTestResultsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListContinuousTestResultsRequest. */ + class ListContinuousTestResultsRequest implements IListContinuousTestResultsRequest { + + /** + * Constructs a new ListContinuousTestResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest); + + /** ListContinuousTestResultsRequest parent. */ + public parent: string; + + /** ListContinuousTestResultsRequest pageSize. */ + public pageSize: number; + + /** ListContinuousTestResultsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListContinuousTestResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContinuousTestResultsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest; + + /** + * Encodes the specified ListContinuousTestResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @param message ListContinuousTestResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContinuousTestResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @param message ListContinuousTestResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContinuousTestResultsRequest + * @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.v3.ListContinuousTestResultsRequest; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContinuousTestResultsRequest + * @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.v3.ListContinuousTestResultsRequest; + + /** + * Verifies a ListContinuousTestResultsRequest 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 ListContinuousTestResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContinuousTestResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest; + + /** + * Creates a plain object from a ListContinuousTestResultsRequest message. Also converts values to other types if specified. + * @param message ListContinuousTestResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContinuousTestResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListContinuousTestResultsResponse. */ + interface IListContinuousTestResultsResponse { + + /** ListContinuousTestResultsResponse continuousTestResults */ + continuousTestResults?: (google.cloud.dialogflow.cx.v3.IContinuousTestResult[]|null); + + /** ListContinuousTestResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListContinuousTestResultsResponse. */ + class ListContinuousTestResultsResponse implements IListContinuousTestResultsResponse { + + /** + * Constructs a new ListContinuousTestResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse); + + /** ListContinuousTestResultsResponse continuousTestResults. */ + public continuousTestResults: google.cloud.dialogflow.cx.v3.IContinuousTestResult[]; + + /** ListContinuousTestResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListContinuousTestResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContinuousTestResultsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse; + + /** + * Encodes the specified ListContinuousTestResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @param message ListContinuousTestResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContinuousTestResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @param message ListContinuousTestResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContinuousTestResultsResponse + * @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.v3.ListContinuousTestResultsResponse; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContinuousTestResultsResponse + * @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.v3.ListContinuousTestResultsResponse; + + /** + * Verifies a ListContinuousTestResultsResponse 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 ListContinuousTestResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContinuousTestResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse; + + /** + * Creates a plain object from a ListContinuousTestResultsResponse message. Also converts values to other types if specified. + * @param message ListContinuousTestResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContinuousTestResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Represents a TestCases */ class TestCases extends $protobuf.rpc.Service { diff --git a/protos/protos.js b/protos/protos.js index 59615abd..73dea47b 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -17394,6 +17394,32 @@ return SecuritySettings; })(); + /** + * AudioEncoding enum. + * @name google.cloud.dialogflow.cx.v3.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value + * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value + * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value + * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value + * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value + * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value + * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value + */ + v3.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; + values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; + values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; + values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; + values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; + values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; + return values; + })(); + v3.SpeechWordInfo = (function() { /** @@ -17658,32 +17684,6 @@ return SpeechWordInfo; })(); - /** - * AudioEncoding enum. - * @name google.cloud.dialogflow.cx.v3.AudioEncoding - * @enum {number} - * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value - * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value - * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value - * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value - * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value - * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value - * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value - * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value - */ - v3.AudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; - values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; - values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; - values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; - values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; - values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; - values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; - return values; - })(); - v3.InputAudioConfig = (function() { /** @@ -21627,6 +21627,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments#runContinuousTest}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef RunContinuousTestCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunContinuousTest. + * @function runContinuousTest + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} request RunContinuousTestRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.RunContinuousTestCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.runContinuousTest = function runContinuousTest(request, callback) { + return this.rpcCall(runContinuousTest, $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunContinuousTest" }); + + /** + * Calls RunContinuousTest. + * @function runContinuousTest + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} request RunContinuousTestRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.cx.v3.Environments#listContinuousTestResults}. + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @typedef ListContinuousTestResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} [response] ListContinuousTestResultsResponse + */ + + /** + * Calls ListContinuousTestResults. + * @function listContinuousTestResults + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} request ListContinuousTestResultsRequest message or plain object + * @param {google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResultsCallback} callback Node-style callback called with the error, if any, and ListContinuousTestResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listContinuousTestResults = function listContinuousTestResults(request, callback) { + return this.rpcCall(listContinuousTestResults, $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest, $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse, request, callback); + }, "name", { value: "ListContinuousTestResults" }); + + /** + * Calls ListContinuousTestResults. + * @function listContinuousTestResults + * @memberof google.cloud.dialogflow.cx.v3.Environments + * @instance + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} request ListContinuousTestResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Environments; })(); @@ -23855,6 +23921,1366 @@ return LookupEnvironmentHistoryResponse; })(); + v3.ContinuousTestResult = (function() { + + /** + * Properties of a ContinuousTestResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IContinuousTestResult + * @property {string|null} [name] ContinuousTestResult name + * @property {google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult|null} [result] ContinuousTestResult result + * @property {Array.|null} [testCaseResults] ContinuousTestResult testCaseResults + * @property {google.protobuf.ITimestamp|null} [runTime] ContinuousTestResult runTime + */ + + /** + * Constructs a new ContinuousTestResult. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ContinuousTestResult. + * @implements IContinuousTestResult + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult=} [properties] Properties to set + */ + function ContinuousTestResult(properties) { + this.testCaseResults = []; + 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]]; + } + + /** + * ContinuousTestResult name. + * @member {string} name + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.name = ""; + + /** + * ContinuousTestResult result. + * @member {google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult} result + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.result = 0; + + /** + * ContinuousTestResult testCaseResults. + * @member {Array.} testCaseResults + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.testCaseResults = $util.emptyArray; + + /** + * ContinuousTestResult runTime. + * @member {google.protobuf.ITimestamp|null|undefined} runTime + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + */ + ContinuousTestResult.prototype.runTime = null; + + /** + * Creates a new ContinuousTestResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult instance + */ + ContinuousTestResult.create = function create(properties) { + return new ContinuousTestResult(properties); + }; + + /** + * Encodes the specified ContinuousTestResult message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult} message ContinuousTestResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousTestResult.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.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.result); + if (message.testCaseResults != null && message.testCaseResults.length) + for (var i = 0; i < message.testCaseResults.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.testCaseResults[i]); + if (message.runTime != null && Object.hasOwnProperty.call(message, "runTime")) + $root.google.protobuf.Timestamp.encode(message.runTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContinuousTestResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.IContinuousTestResult} message ContinuousTestResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContinuousTestResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @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.v3.ContinuousTestResult} ContinuousTestResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousTestResult.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.v3.ContinuousTestResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.result = reader.int32(); + break; + case 3: + if (!(message.testCaseResults && message.testCaseResults.length)) + message.testCaseResults = []; + message.testCaseResults.push(reader.string()); + break; + case 4: + message.runTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContinuousTestResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContinuousTestResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContinuousTestResult message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContinuousTestResult.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"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { + default: + return "result: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.testCaseResults != null && message.hasOwnProperty("testCaseResults")) { + if (!Array.isArray(message.testCaseResults)) + return "testCaseResults: array expected"; + for (var i = 0; i < message.testCaseResults.length; ++i) + if (!$util.isString(message.testCaseResults[i])) + return "testCaseResults: string[] expected"; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.runTime); + if (error) + return "runTime." + error; + } + return null; + }; + + /** + * Creates a ContinuousTestResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ContinuousTestResult} ContinuousTestResult + */ + ContinuousTestResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult(); + if (object.name != null) + message.name = String(object.name); + switch (object.result) { + case "AGGREGATED_TEST_RESULT_UNSPECIFIED": + case 0: + message.result = 0; + break; + case "PASSED": + case 1: + message.result = 1; + break; + case "FAILED": + case 2: + message.result = 2; + break; + } + if (object.testCaseResults) { + if (!Array.isArray(object.testCaseResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ContinuousTestResult.testCaseResults: array expected"); + message.testCaseResults = []; + for (var i = 0; i < object.testCaseResults.length; ++i) + message.testCaseResults[i] = String(object.testCaseResults[i]); + } + if (object.runTime != null) { + if (typeof object.runTime !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ContinuousTestResult.runTime: object expected"); + message.runTime = $root.google.protobuf.Timestamp.fromObject(object.runTime); + } + return message; + }; + + /** + * Creates a plain object from a ContinuousTestResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @static + * @param {google.cloud.dialogflow.cx.v3.ContinuousTestResult} message ContinuousTestResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContinuousTestResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.testCaseResults = []; + if (options.defaults) { + object.name = ""; + object.result = options.enums === String ? "AGGREGATED_TEST_RESULT_UNSPECIFIED" : 0; + object.runTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult[message.result] : message.result; + if (message.testCaseResults && message.testCaseResults.length) { + object.testCaseResults = []; + for (var j = 0; j < message.testCaseResults.length; ++j) + object.testCaseResults[j] = message.testCaseResults[j]; + } + if (message.runTime != null && message.hasOwnProperty("runTime")) + object.runTime = $root.google.protobuf.Timestamp.toObject(message.runTime, options); + return object; + }; + + /** + * Converts this ContinuousTestResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ContinuousTestResult + * @instance + * @returns {Object.} JSON object + */ + ContinuousTestResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AggregatedTestResult enum. + * @name google.cloud.dialogflow.cx.v3.ContinuousTestResult.AggregatedTestResult + * @enum {number} + * @property {number} AGGREGATED_TEST_RESULT_UNSPECIFIED=0 AGGREGATED_TEST_RESULT_UNSPECIFIED value + * @property {number} PASSED=1 PASSED value + * @property {number} FAILED=2 FAILED value + */ + ContinuousTestResult.AggregatedTestResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGGREGATED_TEST_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PASSED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + return ContinuousTestResult; + })(); + + v3.RunContinuousTestRequest = (function() { + + /** + * Properties of a RunContinuousTestRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunContinuousTestRequest + * @property {string|null} [environment] RunContinuousTestRequest environment + */ + + /** + * Constructs a new RunContinuousTestRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunContinuousTestRequest. + * @implements IRunContinuousTestRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest=} [properties] Properties to set + */ + function RunContinuousTestRequest(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]]; + } + + /** + * RunContinuousTestRequest environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @instance + */ + RunContinuousTestRequest.prototype.environment = ""; + + /** + * Creates a new RunContinuousTestRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest instance + */ + RunContinuousTestRequest.create = function create(properties) { + return new RunContinuousTestRequest(properties); + }; + + /** + * Encodes the specified RunContinuousTestRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} message RunContinuousTestRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest} message RunContinuousTestRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @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.v3.RunContinuousTestRequest} RunContinuousTestRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestRequest.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.v3.RunContinuousTestRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.environment = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a RunContinuousTestRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} RunContinuousTestRequest + */ + RunContinuousTestRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest(); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.RunContinuousTestRequest} message RunContinuousTestRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.environment = ""; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this RunContinuousTestRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestRequest + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunContinuousTestRequest; + })(); + + v3.RunContinuousTestResponse = (function() { + + /** + * Properties of a RunContinuousTestResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunContinuousTestResponse + * @property {google.cloud.dialogflow.cx.v3.IContinuousTestResult|null} [continuousTestResult] RunContinuousTestResponse continuousTestResult + */ + + /** + * Constructs a new RunContinuousTestResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunContinuousTestResponse. + * @implements IRunContinuousTestResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse=} [properties] Properties to set + */ + function RunContinuousTestResponse(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]]; + } + + /** + * RunContinuousTestResponse continuousTestResult. + * @member {google.cloud.dialogflow.cx.v3.IContinuousTestResult|null|undefined} continuousTestResult + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @instance + */ + RunContinuousTestResponse.prototype.continuousTestResult = null; + + /** + * Creates a new RunContinuousTestResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse instance + */ + RunContinuousTestResponse.create = function create(properties) { + return new RunContinuousTestResponse(properties); + }; + + /** + * Encodes the specified RunContinuousTestResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse} message RunContinuousTestResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuousTestResult != null && Object.hasOwnProperty.call(message, "continuousTestResult")) + $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.encode(message.continuousTestResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse} message RunContinuousTestResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @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.v3.RunContinuousTestResponse} RunContinuousTestResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestResponse.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.v3.RunContinuousTestResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.continuousTestResult = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.continuousTestResult != null && message.hasOwnProperty("continuousTestResult")) { + var error = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify(message.continuousTestResult); + if (error) + return "continuousTestResult." + error; + } + return null; + }; + + /** + * Creates a RunContinuousTestResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} RunContinuousTestResponse + */ + RunContinuousTestResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse(); + if (object.continuousTestResult != null) { + if (typeof object.continuousTestResult !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RunContinuousTestResponse.continuousTestResult: object expected"); + message.continuousTestResult = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.fromObject(object.continuousTestResult); + } + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.RunContinuousTestResponse} message RunContinuousTestResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.continuousTestResult = null; + if (message.continuousTestResult != null && message.hasOwnProperty("continuousTestResult")) + object.continuousTestResult = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.toObject(message.continuousTestResult, options); + return object; + }; + + /** + * Converts this RunContinuousTestResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestResponse + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunContinuousTestResponse; + })(); + + v3.RunContinuousTestMetadata = (function() { + + /** + * Properties of a RunContinuousTestMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IRunContinuousTestMetadata + * @property {Array.|null} [errors] RunContinuousTestMetadata errors + */ + + /** + * Constructs a new RunContinuousTestMetadata. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a RunContinuousTestMetadata. + * @implements IRunContinuousTestMetadata + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata=} [properties] Properties to set + */ + function RunContinuousTestMetadata(properties) { + this.errors = []; + 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]]; + } + + /** + * RunContinuousTestMetadata errors. + * @member {Array.} errors + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @instance + */ + RunContinuousTestMetadata.prototype.errors = $util.emptyArray; + + /** + * Creates a new RunContinuousTestMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata instance + */ + RunContinuousTestMetadata.create = function create(properties) { + return new RunContinuousTestMetadata(properties); + }; + + /** + * Encodes the specified RunContinuousTestMetadata message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata} message RunContinuousTestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.dialogflow.cx.v3.TestError.encode(message.errors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunContinuousTestMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata} message RunContinuousTestMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunContinuousTestMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @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.v3.RunContinuousTestMetadata} RunContinuousTestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestMetadata.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.v3.RunContinuousTestMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.dialogflow.cx.v3.TestError.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunContinuousTestMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunContinuousTestMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunContinuousTestMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunContinuousTestMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.TestError.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a RunContinuousTestMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} RunContinuousTestMetadata + */ + RunContinuousTestMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata.errors: object expected"); + message.errors[i] = $root.google.cloud.dialogflow.cx.v3.TestError.fromObject(object.errors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RunContinuousTestMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @static + * @param {google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata} message RunContinuousTestMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunContinuousTestMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.dialogflow.cx.v3.TestError.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this RunContinuousTestMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + * @instance + * @returns {Object.} JSON object + */ + RunContinuousTestMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunContinuousTestMetadata; + })(); + + v3.ListContinuousTestResultsRequest = (function() { + + /** + * Properties of a ListContinuousTestResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListContinuousTestResultsRequest + * @property {string|null} [parent] ListContinuousTestResultsRequest parent + * @property {number|null} [pageSize] ListContinuousTestResultsRequest pageSize + * @property {string|null} [pageToken] ListContinuousTestResultsRequest pageToken + */ + + /** + * Constructs a new ListContinuousTestResultsRequest. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListContinuousTestResultsRequest. + * @implements IListContinuousTestResultsRequest + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest=} [properties] Properties to set + */ + function ListContinuousTestResultsRequest(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]]; + } + + /** + * ListContinuousTestResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.parent = ""; + + /** + * ListContinuousTestResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.pageSize = 0; + + /** + * ListContinuousTestResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + */ + ListContinuousTestResultsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListContinuousTestResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest instance + */ + ListContinuousTestResultsRequest.create = function create(properties) { + return new ListContinuousTestResultsRequest(properties); + }; + + /** + * Encodes the specified ListContinuousTestResultsRequest message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} message ListContinuousTestResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsRequest.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 ListContinuousTestResultsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest} message ListContinuousTestResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContinuousTestResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @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.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsRequest.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.v3.ListContinuousTestResultsRequest(); + 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 ListContinuousTestResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContinuousTestResultsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContinuousTestResultsRequest.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 ListContinuousTestResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} ListContinuousTestResultsRequest + */ + ListContinuousTestResultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest(); + 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 ListContinuousTestResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @static + * @param {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest} message ListContinuousTestResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContinuousTestResultsRequest.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 ListContinuousTestResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListContinuousTestResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListContinuousTestResultsRequest; + })(); + + v3.ListContinuousTestResultsResponse = (function() { + + /** + * Properties of a ListContinuousTestResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @interface IListContinuousTestResultsResponse + * @property {Array.|null} [continuousTestResults] ListContinuousTestResultsResponse continuousTestResults + * @property {string|null} [nextPageToken] ListContinuousTestResultsResponse nextPageToken + */ + + /** + * Constructs a new ListContinuousTestResultsResponse. + * @memberof google.cloud.dialogflow.cx.v3 + * @classdesc Represents a ListContinuousTestResultsResponse. + * @implements IListContinuousTestResultsResponse + * @constructor + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse=} [properties] Properties to set + */ + function ListContinuousTestResultsResponse(properties) { + this.continuousTestResults = []; + 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]]; + } + + /** + * ListContinuousTestResultsResponse continuousTestResults. + * @member {Array.} continuousTestResults + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @instance + */ + ListContinuousTestResultsResponse.prototype.continuousTestResults = $util.emptyArray; + + /** + * ListContinuousTestResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @instance + */ + ListContinuousTestResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListContinuousTestResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse instance + */ + ListContinuousTestResultsResponse.create = function create(properties) { + return new ListContinuousTestResultsResponse(properties); + }; + + /** + * Encodes the specified ListContinuousTestResultsResponse message. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse} message ListContinuousTestResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.continuousTestResults != null && message.continuousTestResults.length) + for (var i = 0; i < message.continuousTestResults.length; ++i) + $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.encode(message.continuousTestResults[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 ListContinuousTestResultsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse} message ListContinuousTestResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContinuousTestResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @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.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsResponse.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.v3.ListContinuousTestResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.continuousTestResults && message.continuousTestResults.length)) + message.continuousTestResults = []; + message.continuousTestResults.push($root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContinuousTestResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContinuousTestResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContinuousTestResultsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContinuousTestResultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.continuousTestResults != null && message.hasOwnProperty("continuousTestResults")) { + if (!Array.isArray(message.continuousTestResults)) + return "continuousTestResults: array expected"; + for (var i = 0; i < message.continuousTestResults.length; ++i) { + var error = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.verify(message.continuousTestResults[i]); + if (error) + return "continuousTestResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListContinuousTestResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} ListContinuousTestResultsResponse + */ + ListContinuousTestResultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse) + return object; + var message = new $root.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse(); + if (object.continuousTestResults) { + if (!Array.isArray(object.continuousTestResults)) + throw TypeError(".google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.continuousTestResults: array expected"); + message.continuousTestResults = []; + for (var i = 0; i < object.continuousTestResults.length; ++i) { + if (typeof object.continuousTestResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse.continuousTestResults: object expected"); + message.continuousTestResults[i] = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.fromObject(object.continuousTestResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListContinuousTestResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @static + * @param {google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse} message ListContinuousTestResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContinuousTestResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.continuousTestResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.continuousTestResults && message.continuousTestResults.length) { + object.continuousTestResults = []; + for (var j = 0; j < message.continuousTestResults.length; ++j) + object.continuousTestResults[j] = $root.google.cloud.dialogflow.cx.v3.ContinuousTestResult.toObject(message.continuousTestResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListContinuousTestResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.cx.v3.ListContinuousTestResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListContinuousTestResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListContinuousTestResultsResponse; + })(); + v3.TestCases = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index c8ee0655..f83697a0 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -2105,6 +2105,18 @@ } } }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "AUDIO_ENCODING_LINEAR_16": 1, + "AUDIO_ENCODING_FLAC": 2, + "AUDIO_ENCODING_MULAW": 3, + "AUDIO_ENCODING_AMR": 4, + "AUDIO_ENCODING_AMR_WB": 5, + "AUDIO_ENCODING_OGG_OPUS": 6, + "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7 + } + }, "SpeechWordInfo": { "fields": { "word": { @@ -2125,18 +2137,6 @@ } } }, - "AudioEncoding": { - "values": { - "AUDIO_ENCODING_UNSPECIFIED": 0, - "AUDIO_ENCODING_LINEAR_16": 1, - "AUDIO_ENCODING_FLAC": 2, - "AUDIO_ENCODING_MULAW": 3, - "AUDIO_ENCODING_AMR": 4, - "AUDIO_ENCODING_AMR_WB": 5, - "AUDIO_ENCODING_OGG_OPUS": 6, - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7 - } - }, "InputAudioConfig": { "fields": { "audioEncoding": { @@ -2695,6 +2695,48 @@ "(google.api.method_signature)": "name" } ] + }, + "RunContinuousTest": { + "requestType": "RunContinuousTestRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RunContinuousTestResponse", + "(google.longrunning.operation_info).metadata_type": "RunContinuousTestMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v3/{environment=projects/*/locations/*/agents/*/environments/*}:runContinuousTest", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunContinuousTestResponse", + "metadata_type": "RunContinuousTestMetadata" + } + } + ] + }, + "ListContinuousTestResults": { + "requestType": "ListContinuousTestResultsRequest", + "responseType": "ListContinuousTestResultsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v3/{parent=projects/*/locations/*/agents/*/environments/*}/continuousTestResults" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] } } }, @@ -2877,6 +2919,105 @@ } } }, + "ContinuousTestResult": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ContinuousTestResult", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "result": { + "type": "AggregatedTestResult", + "id": 2 + }, + "testCaseResults": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/TestCaseResult" + } + }, + "runTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "AggregatedTestResult": { + "values": { + "AGGREGATED_TEST_RESULT_UNSPECIFIED": 0, + "PASSED": 1, + "FAILED": 2 + } + } + } + }, + "RunContinuousTestRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Environment" + } + } + } + }, + "RunContinuousTestResponse": { + "fields": { + "continuousTestResult": { + "type": "ContinuousTestResult", + "id": 1 + } + } + }, + "RunContinuousTestMetadata": { + "fields": { + "errors": { + "rule": "repeated", + "type": "TestError", + "id": 1 + } + } + }, + "ListContinuousTestResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ContinuousTestResult" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListContinuousTestResultsResponse": { + "fields": { + "continuousTestResults": { + "rule": "repeated", + "type": "ContinuousTestResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "TestCases": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", diff --git a/src/v3/agents_client.ts b/src/v3/agents_client.ts index 40348166..c0dce0cd 100644 --- a/src/v3/agents_client.ts +++ b/src/v3/agents_client.ts @@ -161,6 +161,9 @@ export class AgentsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1585,6 +1588,101 @@ export class AgentsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/entity_types_client.ts b/src/v3/entity_types_client.ts index fac87534..910c0fa7 100644 --- a/src/v3/entity_types_client.ts +++ b/src/v3/entity_types_client.ts @@ -159,6 +159,9 @@ export class EntityTypesClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1129,6 +1132,101 @@ export class EntityTypesClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/environments_client.ts b/src/v3/environments_client.ts index eb95c3e8..c7b3d958 100644 --- a/src/v3/environments_client.ts +++ b/src/v3/environments_client.ts @@ -161,6 +161,9 @@ export class EnvironmentsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -230,6 +233,11 @@ export class EnvironmentsClient { 'nextPageToken', 'environments' ), + listContinuousTestResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'continuousTestResults' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -256,6 +264,12 @@ export class EnvironmentsClient { const updateEnvironmentMetadata = protoFilesRoot.lookup( '.google.protobuf.Struct' ) as gax.protobuf.Type; + const runContinuousTestResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse' + ) as gax.protobuf.Type; + const runContinuousTestMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEnvironment: new this._gaxModule.LongrunningDescriptor( @@ -268,6 +282,11 @@ export class EnvironmentsClient { updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata) ), + runContinuousTest: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runContinuousTestResponse.decode.bind(runContinuousTestResponse), + runContinuousTestMetadata.decode.bind(runContinuousTestMetadata) + ), }; // Put together the default options sent with requests. @@ -322,6 +341,8 @@ export class EnvironmentsClient { 'updateEnvironment', 'deleteEnvironment', 'lookupEnvironmentHistory', + 'runContinuousTest', + 'listContinuousTestResults', ]; for (const methodName of environmentsStubMethods) { const callPromise = this.environmentsStub.then( @@ -890,6 +911,148 @@ export class EnvironmentsClient { protos.google.protobuf.Struct >; } + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Kicks off a continuous test under the specified {@link google.cloud.dialogflow.cx.v3.Environment|Environment}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * Required. Format: `projects//locations//agents//environments/`. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.runContinuousTest(request); + * const [response] = await operation.promise(); + */ + runContinuousTest( + request: protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >, + protos.google.longrunning.IOperation | 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({ + environment: request.environment || '', + }); + this.initialize(); + return this.innerApiCalls.runContinuousTest(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runContinuousTest()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRunContinuousTestProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRunContinuousTestProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.runContinuousTest, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.RunContinuousTestMetadata + >; + } listEnvironments( request: protos.google.cloud.dialogflow.cx.v3.IListEnvironmentsRequest, options?: CallOptions @@ -1291,6 +1454,210 @@ export class EnvironmentsClient { callSettings ) as AsyncIterable; } + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + ] + >; + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + > + ): void; + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + > + ): void; + /** + * Fetches a list of continuous test results for a given environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The environment to list results for. + * Format: `projects//locations//agents// + * environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @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 [ContinuousTestResult]{@link google.cloud.dialogflow.cx.v3.ContinuousTestResult}. + * 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 `listContinuousTestResultsAsync()` + * 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. + */ + listContinuousTestResults( + request: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + | protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + | null + | undefined, + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult + > + ): Promise< + [ + protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[], + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest | null, + protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsResponse + ] + > | 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.listContinuousTestResults( + 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 environment to list results for. + * Format: `projects//locations//agents// + * environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @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 [ContinuousTestResult]{@link google.cloud.dialogflow.cx.v3.ContinuousTestResult} 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 `listContinuousTestResultsAsync()` + * 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. + */ + listContinuousTestResultsStream( + request?: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + 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.listContinuousTestResults.createStream( + this.innerApiCalls.listContinuousTestResults as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listContinuousTestResults`, 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 environment to list results for. + * Format: `projects//locations//agents// + * environments/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @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 + * [ContinuousTestResult]{@link google.cloud.dialogflow.cx.v3.ContinuousTestResult}. 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.listContinuousTestResultsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listContinuousTestResultsAsync( + request?: protos.google.cloud.dialogflow.cx.v3.IListContinuousTestResultsRequest, + 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.listContinuousTestResults.asyncIterate( + this.innerApiCalls['listContinuousTestResults'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -1401,6 +1768,101 @@ export class EnvironmentsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/environments_client_config.json b/src/v3/environments_client_config.json index 3875718b..40281fb4 100644 --- a/src/v3/environments_client_config.json +++ b/src/v3/environments_client_config.json @@ -52,6 +52,16 @@ "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "default" + }, + "RunContinuousTest": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListContinuousTestResults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" } } } diff --git a/src/v3/experiments_client.ts b/src/v3/experiments_client.ts index f93b7675..775f4ec9 100644 --- a/src/v3/experiments_client.ts +++ b/src/v3/experiments_client.ts @@ -159,6 +159,9 @@ export class ExperimentsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1236,6 +1239,101 @@ export class ExperimentsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/flows_client.ts b/src/v3/flows_client.ts index e5313cbf..7650d9ed 100644 --- a/src/v3/flows_client.ts +++ b/src/v3/flows_client.ts @@ -161,6 +161,9 @@ export class FlowsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1836,6 +1839,101 @@ export class FlowsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/gapic_metadata.json b/src/v3/gapic_metadata.json index 910ce1cf..60f65571 100644 --- a/src/v3/gapic_metadata.json +++ b/src/v3/gapic_metadata.json @@ -206,6 +206,11 @@ "updateEnvironment" ] }, + "RunContinuousTest": { + "methods": [ + "runContinuousTest" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", @@ -219,6 +224,13 @@ "lookupEnvironmentHistoryStream", "lookupEnvironmentHistoryAsync" ] + }, + "ListContinuousTestResults": { + "methods": [ + "listContinuousTestResults", + "listContinuousTestResultsStream", + "listContinuousTestResultsAsync" + ] } } }, @@ -245,6 +257,11 @@ "updateEnvironment" ] }, + "RunContinuousTest": { + "methods": [ + "runContinuousTest" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", @@ -258,6 +275,13 @@ "lookupEnvironmentHistoryStream", "lookupEnvironmentHistoryAsync" ] + }, + "ListContinuousTestResults": { + "methods": [ + "listContinuousTestResults", + "listContinuousTestResultsStream", + "listContinuousTestResultsAsync" + ] } } } diff --git a/src/v3/intents_client.ts b/src/v3/intents_client.ts index 380c2005..7ee94d8b 100644 --- a/src/v3/intents_client.ts +++ b/src/v3/intents_client.ts @@ -159,6 +159,9 @@ export class IntentsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1107,6 +1110,101 @@ export class IntentsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/pages_client.ts b/src/v3/pages_client.ts index 7b9032f3..33fcf224 100644 --- a/src/v3/pages_client.ts +++ b/src/v3/pages_client.ts @@ -159,6 +159,9 @@ export class PagesClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1182,6 +1185,101 @@ export class PagesClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/security_settings_service_client.ts b/src/v3/security_settings_service_client.ts index 9d525ac7..47d72bb5 100644 --- a/src/v3/security_settings_service_client.ts +++ b/src/v3/security_settings_service_client.ts @@ -160,6 +160,9 @@ export class SecuritySettingsServiceClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1083,6 +1086,101 @@ export class SecuritySettingsServiceClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/session_entity_types_client.ts b/src/v3/session_entity_types_client.ts index 5974182d..133a57ff 100644 --- a/src/v3/session_entity_types_client.ts +++ b/src/v3/session_entity_types_client.ts @@ -159,6 +159,9 @@ export class SessionEntityTypesClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1116,6 +1119,101 @@ export class SessionEntityTypesClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/sessions_client.ts b/src/v3/sessions_client.ts index 197378d0..cb54a6c5 100644 --- a/src/v3/sessions_client.ts +++ b/src/v3/sessions_client.ts @@ -152,6 +152,9 @@ export class SessionsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -817,6 +820,101 @@ export class SessionsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/test_cases_client.ts b/src/v3/test_cases_client.ts index 3c8ab51e..7a393f34 100644 --- a/src/v3/test_cases_client.ts +++ b/src/v3/test_cases_client.ts @@ -162,6 +162,9 @@ export class TestCasesClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -2223,6 +2226,101 @@ export class TestCasesClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/transition_route_groups_client.ts b/src/v3/transition_route_groups_client.ts index fc5f04b3..12142c04 100644 --- a/src/v3/transition_route_groups_client.ts +++ b/src/v3/transition_route_groups_client.ts @@ -160,6 +160,9 @@ export class TransitionRouteGroupsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1179,6 +1182,101 @@ export class TransitionRouteGroupsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/versions_client.ts b/src/v3/versions_client.ts index 921f861b..5c77037a 100644 --- a/src/v3/versions_client.ts +++ b/src/v3/versions_client.ts @@ -161,6 +161,9 @@ export class VersionsClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1286,6 +1289,101 @@ export class VersionsClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/src/v3/webhooks_client.ts b/src/v3/webhooks_client.ts index be108898..81370f3a 100644 --- a/src/v3/webhooks_client.ts +++ b/src/v3/webhooks_client.ts @@ -159,6 +159,9 @@ export class WebhooksClient { agentValidationResultPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/validationResult' ), + continuousTestResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/continuousTestResults/{continuous_test_result}' + ), entityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}' ), @@ -1060,6 +1063,101 @@ export class WebhooksClient { ).agent; } + /** + * Return a fully-qualified continuousTestResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} agent + * @param {string} environment + * @param {string} continuous_test_result + * @returns {string} Resource name string. + */ + continuousTestResultPath( + project: string, + location: string, + agent: string, + environment: string, + continuousTestResult: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.render({ + project: project, + location: location, + agent: agent, + environment: environment, + continuous_test_result: continuousTestResult, + }); + } + + /** + * Parse the project from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).project; + } + + /** + * Parse the location from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).location; + } + + /** + * Parse the agent from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the agent. + */ + matchAgentFromContinuousTestResultName(continuousTestResultName: string) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).agent; + } + + /** + * Parse the environment from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).environment; + } + + /** + * Parse the continuous_test_result from ContinuousTestResult resource. + * + * @param {string} continuousTestResultName + * A fully-qualified path representing ContinuousTestResult resource. + * @returns {string} A string representing the continuous_test_result. + */ + matchContinuousTestResultFromContinuousTestResultName( + continuousTestResultName: string + ) { + return this.pathTemplates.continuousTestResultPathTemplate.match( + continuousTestResultName + ).continuous_test_result; + } + /** * Return a fully-qualified entityType resource name string. * diff --git a/test/gapic_agents_v3.ts b/test/gapic_agents_v3.ts index 78e2d603..c082f2af 100644 --- a/test/gapic_agents_v3.ts +++ b/test/gapic_agents_v3.ts @@ -1703,6 +1703,118 @@ describe('v3.AgentsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new agentsModule.v3.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_entity_types_v3.ts b/test/gapic_entity_types_v3.ts index b3c45388..71bbb5ce 100644 --- a/test/gapic_entity_types_v3.ts +++ b/test/gapic_entity_types_v3.ts @@ -1089,6 +1089,118 @@ describe('v3.EntityTypesClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new entitytypesModule.v3.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_environments_v3.ts b/test/gapic_environments_v3.ts index 8bd5a8d0..277741e0 100644 --- a/test/gapic_environments_v3.ts +++ b/test/gapic_environments_v3.ts @@ -839,6 +839,200 @@ describe('v3.EnvironmentsClient', () => { }); }); + describe('runContinuousTest', () => { + it('invokes runContinuousTest without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runContinuousTest = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runContinuousTest(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runContinuousTest as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runContinuousTest without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runContinuousTest = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runContinuousTest( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestResponse, + protos.google.cloud.dialogflow.cx.v3.IRunContinuousTestMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runContinuousTest as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes runContinuousTest with call error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runContinuousTest = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runContinuousTest(request), expectedError); + assert( + (client.innerApiCalls.runContinuousTest as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes runContinuousTest with LRO error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.RunContinuousTestRequest() + ); + request.environment = ''; + const expectedHeaderRequestParams = 'environment='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runContinuousTest = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runContinuousTest(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.runContinuousTest as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRunContinuousTestProgress without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunContinuousTestProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunContinuousTestProgress with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunContinuousTestProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEnvironments', () => { it('invokes listEnvironments without error', async () => { const client = new environmentsModule.v3.EnvironmentsClient({ @@ -1471,6 +1665,337 @@ describe('v3.EnvironmentsClient', () => { }); }); + describe('listContinuousTestResults', () => { + it('invokes listContinuousTestResults without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + ]; + client.innerApiCalls.listContinuousTestResults = + stubSimpleCall(expectedResponse); + const [response] = await client.listContinuousTestResults(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listContinuousTestResults as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listContinuousTestResults without error using callback', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + ]; + client.innerApiCalls.listContinuousTestResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listContinuousTestResults( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listContinuousTestResults as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listContinuousTestResults with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listContinuousTestResults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listContinuousTestResults(request), + expectedError + ); + assert( + (client.innerApiCalls.listContinuousTestResults as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listContinuousTestResultsStream without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + ]; + client.descriptors.page.listContinuousTestResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listContinuousTestResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult + ) => { + 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.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listContinuousTestResults, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listContinuousTestResultsStream with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listContinuousTestResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listContinuousTestResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listContinuousTestResults, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listContinuousTestResults + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContinuousTestResults without error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ContinuousTestResult() + ), + ]; + client.descriptors.page.listContinuousTestResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[] = + []; + const iterable = client.listContinuousTestResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listContinuousTestResults with error', async () => { + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.cx.v3.ListContinuousTestResultsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listContinuousTestResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listContinuousTestResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.cx.v3.IContinuousTestResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listContinuousTestResults + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('agent', () => { const fakePath = '/rendered/path/agent'; @@ -1614,6 +2139,118 @@ describe('v3.EnvironmentsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new environmentsModule.v3.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_experiments_v3.ts b/test/gapic_experiments_v3.ts index 39b0426f..4354b674 100644 --- a/test/gapic_experiments_v3.ts +++ b/test/gapic_experiments_v3.ts @@ -1311,6 +1311,118 @@ describe('v3.ExperimentsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new experimentsModule.v3.ExperimentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_flows_v3.ts b/test/gapic_flows_v3.ts index aab0681a..934df284 100644 --- a/test/gapic_flows_v3.ts +++ b/test/gapic_flows_v3.ts @@ -1884,6 +1884,118 @@ describe('v3.FlowsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new flowsModule.v3.FlowsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_intents_v3.ts b/test/gapic_intents_v3.ts index 423c65cf..d0a030b3 100644 --- a/test/gapic_intents_v3.ts +++ b/test/gapic_intents_v3.ts @@ -1089,6 +1089,118 @@ describe('v3.IntentsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new intentsModule.v3.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_pages_v3.ts b/test/gapic_pages_v3.ts index 3daf173e..91bf9642 100644 --- a/test/gapic_pages_v3.ts +++ b/test/gapic_pages_v3.ts @@ -1056,6 +1056,118 @@ describe('v3.PagesClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new pagesModule.v3.PagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_security_settings_service_v3.ts b/test/gapic_security_settings_service_v3.ts index 07b77e05..57706f57 100644 --- a/test/gapic_security_settings_service_v3.ts +++ b/test/gapic_security_settings_service_v3.ts @@ -1140,6 +1140,119 @@ describe('v3.SecuritySettingsServiceClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new securitysettingsserviceModule.v3.SecuritySettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_session_entity_types_v3.ts b/test/gapic_session_entity_types_v3.ts index 97a43e5c..4c583c37 100644 --- a/test/gapic_session_entity_types_v3.ts +++ b/test/gapic_session_entity_types_v3.ts @@ -1129,6 +1129,118 @@ describe('v3.SessionEntityTypesClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new sessionentitytypesModule.v3.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_sessions_v3.ts b/test/gapic_sessions_v3.ts index bff521ce..d03470e2 100644 --- a/test/gapic_sessions_v3.ts +++ b/test/gapic_sessions_v3.ts @@ -714,6 +714,118 @@ describe('v3.SessionsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new sessionsModule.v3.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_test_cases_v3.ts b/test/gapic_test_cases_v3.ts index c5907dc9..499fa9e7 100644 --- a/test/gapic_test_cases_v3.ts +++ b/test/gapic_test_cases_v3.ts @@ -2427,6 +2427,118 @@ describe('v3.TestCasesClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new testcasesModule.v3.TestCasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_transition_route_groups_v3.ts b/test/gapic_transition_route_groups_v3.ts index a8e40cee..14cf1fdb 100644 --- a/test/gapic_transition_route_groups_v3.ts +++ b/test/gapic_transition_route_groups_v3.ts @@ -1160,6 +1160,119 @@ describe('v3.TransitionRouteGroupsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = + new transitionroutegroupsModule.v3.TransitionRouteGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_versions_v3.ts b/test/gapic_versions_v3.ts index 0e3a34d9..3b91cd03 100644 --- a/test/gapic_versions_v3.ts +++ b/test/gapic_versions_v3.ts @@ -1395,6 +1395,118 @@ describe('v3.VersionsClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new versionsModule.v3.VersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = { diff --git a/test/gapic_webhooks_v3.ts b/test/gapic_webhooks_v3.ts index b4f98e35..89fcff50 100644 --- a/test/gapic_webhooks_v3.ts +++ b/test/gapic_webhooks_v3.ts @@ -1090,6 +1090,118 @@ describe('v3.WebhooksClient', () => { }); }); + describe('continuousTestResult', () => { + const fakePath = '/rendered/path/continuousTestResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + agent: 'agentValue', + environment: 'environmentValue', + continuous_test_result: 'continuousTestResultValue', + }; + const client = new webhooksModule.v3.WebhooksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.continuousTestResultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.continuousTestResultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('continuousTestResultPath', () => { + const result = client.continuousTestResultPath( + 'projectValue', + 'locationValue', + 'agentValue', + 'environmentValue', + 'continuousTestResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContinuousTestResultName', () => { + const result = + client.matchProjectFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContinuousTestResultName', () => { + const result = + client.matchLocationFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAgentFromContinuousTestResultName', () => { + const result = client.matchAgentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'agentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromContinuousTestResultName', () => { + const result = + client.matchEnvironmentFromContinuousTestResultName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContinuousTestResultFromContinuousTestResultName', () => { + const result = + client.matchContinuousTestResultFromContinuousTestResultName( + fakePath + ); + assert.strictEqual(result, 'continuousTestResultValue'); + assert( + ( + client.pathTemplates.continuousTestResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('entityType', () => { const fakePath = '/rendered/path/entityType'; const expectedParameters = {