diff --git a/packages/google-cloud-ces/.eslintrc.json b/packages/google-cloud-ces/.eslintrc.json index 78215349546..3e8d97ccb39 100644 --- a/packages/google-cloud-ces/.eslintrc.json +++ b/packages/google-cloud-ces/.eslintrc.json @@ -1,3 +1,4 @@ { - "extends": "./node_modules/gts" + "extends": "./node_modules/gts", + "root": true } diff --git a/packages/google-cloud-ces/README.md b/packages/google-cloud-ces/README.md index 12ad043a3e3..b03a3894ab5 100644 --- a/packages/google-cloud-ces/README.md +++ b/packages/google-cloud-ces/README.md @@ -132,6 +132,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | delete tool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_tool.js) | | delete toolset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.delete_toolset.js) | | export app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.export_app.js) | +| generate app resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.generate_app_resource.js) | | get agent | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_agent.js) | | get app | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app.js) | | get app version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-ces/samples/generated/v1beta/agent_service.get_app_version.js) | diff --git a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto index db9661b816a..ec33baeda5d 100644 --- a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto +++ b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_service.proto @@ -28,6 +28,7 @@ import "google/cloud/ces/v1beta/conversation.proto"; import "google/cloud/ces/v1beta/deployment.proto"; import "google/cloud/ces/v1beta/evaluation.proto"; import "google/cloud/ces/v1beta/example.proto"; +import "google/cloud/ces/v1beta/file_context.proto"; import "google/cloud/ces/v1beta/guardrail.proto"; import "google/cloud/ces/v1beta/security_settings.proto"; import "google/cloud/ces/v1beta/tool.proto"; @@ -36,6 +37,7 @@ import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; option java_multiple_files = true; @@ -502,6 +504,20 @@ service AgentService { }; } + // Generates specific resources (e.g. agent) in the app using LLM assistant. + rpc GenerateAppResource(GenerateAppResourceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/apps/*}:generateAppResource" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "GenerateAppResourceResponse" + metadata_type: "GenerateAppResourceOperationMetadata" + }; + } + // Lists the changelogs of the specified app. rpc ListChangelogs(ListChangelogsRequest) returns (ListChangelogsResponse) { option (google.api.http) = { @@ -1657,6 +1673,194 @@ message RestoreAppVersionRequest { // [AgentService.RestoreAppVersion][google.cloud.ces.v1beta.AgentService.RestoreAppVersion] message RestoreAppVersionResponse {} +// Request message for +// [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource]. +message GenerateAppResourceRequest { + // The instructions to be used to refine a part of the resource. The part of + // the resource can be specified with a start index, end index and a field + // mask. For example, if you want to refine a part of the agent instructions + // you can specify the index of the first character of the instructions, the + // index of the last character of the instructions and the field mask as + // "instructions". + message RefineInstructions { + // Required. The first character (inclusive) of the text to refine. + int64 start_index = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The last character (inclusive) of the text to refine. + int64 end_index = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The field of the resource being refined. Only one field is + // allowed per RefineInstructions. If refining agent instructions, the field + // mask should be "instructions". + google.protobuf.FieldMask field_mask = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The instructions to refine the resource. + string instructions = 4 [(google.api.field_behavior) = REQUIRED]; + } + + // The configuration to be used to generate a tool. + message ToolGenerationConfig { + // The configuration to be used to generate an Open API schema. + message OpenApiToolsetGenerationConfig { + // The configuration to be used to generate an operation in the Open API + // schema. + message OperationGenerationConfig { + // Required. The uri of the tool. This should include query and path + // parameters if any. + string method = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The path of the tool to be appended to the base uri. This + // should include query and path parameters if any. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A sample request to the tool in JSON format. Skip if the + // tool does not support request body. + string request_json = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. A sample response from the tool in JSON format. + string response_json = 4 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The base uri of the tool. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of operations to be added to the Open API schema. + repeated OperationGenerationConfig operation_generation_configs = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. The context which describes the tool to be generated. This can + // be empty if the tool request & response are provided. + string context = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The files to be used as context. + repeated FileContext file_contexts = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used to generate an Open API schema. + OpenApiToolsetGenerationConfig open_api_toolset_generation_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The configuration to be used to generate the app. + message AppGenerationConfig { + // Optional. The context which describes the requirements of the agents & + // tools to be generated. + string context = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The files to be used as context. + repeated FileContext file_contexts = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The insights dataset to be used to fetch conversation data for + // generating the agents & tools. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}`. + string dataset_id = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Dataset" + } + ]; + + // Optional. Whether to generate the evaluations for the app. If true, the + // provided context will be used to generate the evaluations data. + bool generate_evaluations = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage location to store the generated question + // answer data to be used by the Datastore tool. This data is generated only + // when using conversation data as an input source. The location must be + // in the same project as the app. + // Format: `gs://...`. + string gcs_location = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // The configuration to be used to generate the evaluations. + message EvaluationGenerationConfig { + // Optional. The insights dataset to be used to fetch conversation data for + // generating the evaluations. + // Format: + // `projects/{project}/locations/{location}/datasets/{dataset}`. + string dataset_id = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Dataset" + } + ]; + } + + // The configuration to be used to generate the evaluation personas. + message EvaluationPersonasGenerationConfig {} + + // The configuration to be used for quality report generation. + message QualityReportGenerationConfig { + // Required. The evaluation run used to inform quality report analysis. + string evaluation_run = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "ces.googleapis.com/EvaluationRun" + } + ]; + } + + // The configuration to be used for hill climbing fixes. + message HillClimbingFixConfig { + // Required. The quality report used to inform the instruction following + // fix. + QualityReport quality_report = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The resource to generate. + oneof resource { + // The agent resource to be used by the LLM assistant, can be empty for + // generating a new agent. + Agent agent = 2; + + // The tool resource to be used by the LLM assistant, can be empty for + // generating a new tool. + Tool tool = 4; + + // The toolset resource to be used by the LLM assistant, can be empty for + // generating a new toolset. + Toolset toolset = 6; + } + + // Required. The resource name of the app to generate the resource for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "ces.googleapis.com/App" } + ]; + + // Optional. List of refine instructions to be used to refine the resource. + repeated RefineInstructions refine_instructions = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used to generate the tool. + ToolGenerationConfig tool_generation_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used to generate the agents and tools. + AppGenerationConfig app_generation_config = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used to generate the evaluations. + EvaluationGenerationConfig evaluation_generation_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used to generate the evaluation personas. + EvaluationPersonasGenerationConfig evaluation_personas_generation_config = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used for quality report generation. + QualityReportGenerationConfig quality_report_generation_config = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration to be used for hill climbing fixes. + HillClimbingFixConfig hill_climbing_fix_config = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + // Response message for // [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource]. message GenerateAppResourceResponse { @@ -1756,6 +1960,66 @@ message QualityReport { repeated Issue general_issues = 3 [(google.api.field_behavior) = OPTIONAL]; } +// Operation metadata for +// [AgentService.GenerateAppResource][google.cloud.ces.v1beta.AgentService.GenerateAppResource]. +message GenerateAppResourceOperationMetadata { + // The type of the generation operation. + enum GenerationType { + // Unspecified operation type. + GENERATION_TYPE_UNSPECIFIED = 0; + + // Agent instruction restructure type. + AGENT_RESTRUCTURE = 1; + + // Agent instruction refinement type. + AGENT_REFINE = 2; + + // Agent creation from type. + AGENT_CREATE = 3; + + // Tool creation type. + TOOL_CREATE = 4; + + // Scenario creation type. + SCENARIO_CREATE = 5; + + // Scenario creation from transcripts type. + SCENARIO_CREATE_FROM_TRANSCRIPTS = 7; + + // Evaluation persona generation type. + EVALUATION_PERSONA_CREATE = 6; + + // Quality report generation type. + QUALITY_REPORT_CREATE = 8; + + // Instruction following fix type (used for hill climbing fixes). + INSTRUCTION_FOLLOWING_FIX = 9; + } + + // Output only. The type of the operation. + GenerationType generation_type = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource name of the app that the operation is associated + // with. Format: `projects/{project}/locations/{location}/apps/{app}`. + string target = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error messages from the resource generation process. + repeated google.rpc.Status partial_errors = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Request message for // [AgentService.ListChangelogs][google.cloud.ces.v1beta.AgentService.ListChangelogs]. message ListChangelogsRequest { diff --git a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_tool.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_tool.proto index 7e14d6ffe11..92e845c8a13 100644 --- a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_tool.proto +++ b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/agent_tool.proto @@ -32,9 +32,18 @@ message AgentTool { // Optional. Description of the tool's purpose. string description = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The resource name of the root agent that is the entry point of - // the tool. Format: `projects/{project}/locations/{location}/agents/{agent}` + // Optional. Deprecated: Use `agent` instead. + // The resource name of the root agent that is the entry point of the tool. + // Format: `projects/{project}/locations/{location}/agents/{agent}` string root_agent = 3 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } + ]; + + // Optional. The resource name of the agent that is the entry point of the + // tool. Format: `projects/{project}/locations/{location}/agents/{agent}` + string agent = 4 [ (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { type: "ces.googleapis.com/Agent" } ]; diff --git a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto index 6b4b01e2d21..71227c03a78 100644 --- a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto +++ b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/conversation.proto @@ -77,6 +77,10 @@ message Conversation { // The conversation is from the evaluation. EVAL = 3; + + // The conversation is from an agent tool. Agent tool runs the agent in a + // separate session, which is persisted for testing and debugging purposes. + AGENT_TOOL = 4; } // Type of the input message. diff --git a/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/file_context.proto b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/file_context.proto new file mode 100644 index 00000000000..b32831cca69 --- /dev/null +++ b/packages/google-cloud-ces/protos/google/cloud/ces/v1beta/file_context.proto @@ -0,0 +1,45 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.ces.v1beta; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb"; +option java_multiple_files = true; +option java_outer_classname = "FileContextProto"; +option java_package = "com.google.cloud.ces.v1beta"; + +// Files to be used as context. Files can be provided as raw bytes. +message FileContext { + // File provided as raw bytes. + message FileBytes { + // Required. The name of the file provided as raw bytes. + string file_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IANA standard MIME type of the source data. + string mime_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Raw bytes of the file. + bytes data = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // File provided as context. + oneof file { + // Optional. File provided as raw bytes. + FileBytes file_bytes = 1 [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/packages/google-cloud-ces/protos/protos.d.ts b/packages/google-cloud-ces/protos/protos.d.ts index 4062049f880..05284b518b2 100644 --- a/packages/google-cloud-ces/protos/protos.d.ts +++ b/packages/google-cloud-ces/protos/protos.d.ts @@ -29877,6 +29877,20 @@ export namespace google { */ public restoreAppVersion(request: google.cloud.ces.v1beta.IRestoreAppVersionRequest): Promise; + /** + * Calls GenerateAppResource. + * @param request GenerateAppResourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public generateAppResource(request: google.cloud.ces.v1beta.IGenerateAppResourceRequest, callback: google.cloud.ces.v1beta.AgentService.GenerateAppResourceCallback): void; + + /** + * Calls GenerateAppResource. + * @param request GenerateAppResourceRequest message or plain object + * @returns Promise + */ + public generateAppResource(request: google.cloud.ces.v1beta.IGenerateAppResourceRequest): Promise; + /** * Calls ListChangelogs. * @param request ListChangelogsRequest message or plain object @@ -30244,6 +30258,13 @@ export namespace google { */ type RestoreAppVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|generateAppResource}. + * @param error Error, if any + * @param [response] Operation + */ + type GenerateAppResourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. * @param error Error, if any @@ -36777,26 +36798,1140 @@ export namespace google { */ public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.RestoreAppVersionResponse; - /** - * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. - * @param message RestoreAppVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a RestoreAppVersionResponse message. Also converts values to other types if specified. + * @param message RestoreAppVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.RestoreAppVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAppVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreAppVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAppResourceRequest. */ + interface IGenerateAppResourceRequest { + + /** GenerateAppResourceRequest agent */ + agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** GenerateAppResourceRequest tool */ + tool?: (google.cloud.ces.v1beta.ITool|null); + + /** GenerateAppResourceRequest toolset */ + toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** GenerateAppResourceRequest parent */ + parent?: (string|null); + + /** GenerateAppResourceRequest refineInstructions */ + refineInstructions?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions[]|null); + + /** GenerateAppResourceRequest toolGenerationConfig */ + toolGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig|null); + + /** GenerateAppResourceRequest appGenerationConfig */ + appGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig|null); + + /** GenerateAppResourceRequest evaluationGenerationConfig */ + evaluationGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig|null); + + /** GenerateAppResourceRequest evaluationPersonasGenerationConfig */ + evaluationPersonasGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig|null); + + /** GenerateAppResourceRequest qualityReportGenerationConfig */ + qualityReportGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig|null); + + /** GenerateAppResourceRequest hillClimbingFixConfig */ + hillClimbingFixConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig|null); + } + + /** Represents a GenerateAppResourceRequest. */ + class GenerateAppResourceRequest implements IGenerateAppResourceRequest { + + /** + * Constructs a new GenerateAppResourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateAppResourceRequest); + + /** GenerateAppResourceRequest agent. */ + public agent?: (google.cloud.ces.v1beta.IAgent|null); + + /** GenerateAppResourceRequest tool. */ + public tool?: (google.cloud.ces.v1beta.ITool|null); + + /** GenerateAppResourceRequest toolset. */ + public toolset?: (google.cloud.ces.v1beta.IToolset|null); + + /** GenerateAppResourceRequest parent. */ + public parent: string; + + /** GenerateAppResourceRequest refineInstructions. */ + public refineInstructions: google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions[]; + + /** GenerateAppResourceRequest toolGenerationConfig. */ + public toolGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig|null); + + /** GenerateAppResourceRequest appGenerationConfig. */ + public appGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig|null); + + /** GenerateAppResourceRequest evaluationGenerationConfig. */ + public evaluationGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig|null); + + /** GenerateAppResourceRequest evaluationPersonasGenerationConfig. */ + public evaluationPersonasGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig|null); + + /** GenerateAppResourceRequest qualityReportGenerationConfig. */ + public qualityReportGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig|null); + + /** GenerateAppResourceRequest hillClimbingFixConfig. */ + public hillClimbingFixConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig|null); + + /** GenerateAppResourceRequest resource. */ + public resource?: ("agent"|"tool"|"toolset"); + + /** + * Creates a new GenerateAppResourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAppResourceRequest instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateAppResourceRequest): google.cloud.ces.v1beta.GenerateAppResourceRequest; + + /** + * Encodes the specified GenerateAppResourceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.verify|verify} messages. + * @param message GenerateAppResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateAppResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAppResourceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.verify|verify} messages. + * @param message GenerateAppResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateAppResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAppResourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAppResourceRequest + * @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.ces.v1beta.GenerateAppResourceRequest; + + /** + * Decodes a GenerateAppResourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAppResourceRequest + * @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.ces.v1beta.GenerateAppResourceRequest; + + /** + * Verifies a GenerateAppResourceRequest 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 GenerateAppResourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAppResourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest; + + /** + * Creates a plain object from a GenerateAppResourceRequest message. Also converts values to other types if specified. + * @param message GenerateAppResourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAppResourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAppResourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateAppResourceRequest { + + /** Properties of a RefineInstructions. */ + interface IRefineInstructions { + + /** RefineInstructions startIndex */ + startIndex?: (number|Long|string|null); + + /** RefineInstructions endIndex */ + endIndex?: (number|Long|string|null); + + /** RefineInstructions fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** RefineInstructions instructions */ + instructions?: (string|null); + } + + /** Represents a RefineInstructions. */ + class RefineInstructions implements IRefineInstructions { + + /** + * Constructs a new RefineInstructions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions); + + /** RefineInstructions startIndex. */ + public startIndex: (number|Long|string); + + /** RefineInstructions endIndex. */ + public endIndex: (number|Long|string); + + /** RefineInstructions fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** RefineInstructions instructions. */ + public instructions: string; + + /** + * Creates a new RefineInstructions instance using the specified properties. + * @param [properties] Properties to set + * @returns RefineInstructions instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions): google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions; + + /** + * Encodes the specified RefineInstructions message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.verify|verify} messages. + * @param message RefineInstructions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RefineInstructions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.verify|verify} messages. + * @param message RefineInstructions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RefineInstructions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RefineInstructions + * @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.ces.v1beta.GenerateAppResourceRequest.RefineInstructions; + + /** + * Decodes a RefineInstructions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RefineInstructions + * @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.ces.v1beta.GenerateAppResourceRequest.RefineInstructions; + + /** + * Verifies a RefineInstructions 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 RefineInstructions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RefineInstructions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions; + + /** + * Creates a plain object from a RefineInstructions message. Also converts values to other types if specified. + * @param message RefineInstructions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RefineInstructions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RefineInstructions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolGenerationConfig. */ + interface IToolGenerationConfig { + + /** ToolGenerationConfig context */ + context?: (string|null); + + /** ToolGenerationConfig fileContexts */ + fileContexts?: (google.cloud.ces.v1beta.IFileContext[]|null); + + /** ToolGenerationConfig openApiToolsetGenerationConfig */ + openApiToolsetGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig|null); + } + + /** Represents a ToolGenerationConfig. */ + class ToolGenerationConfig implements IToolGenerationConfig { + + /** + * Constructs a new ToolGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig); + + /** ToolGenerationConfig context. */ + public context: string; + + /** ToolGenerationConfig fileContexts. */ + public fileContexts: google.cloud.ces.v1beta.IFileContext[]; + + /** ToolGenerationConfig openApiToolsetGenerationConfig. */ + public openApiToolsetGenerationConfig?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig|null); + + /** + * Creates a new ToolGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig; + + /** + * Encodes the specified ToolGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.verify|verify} messages. + * @param message ToolGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.verify|verify} messages. + * @param message ToolGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig; + + /** + * Decodes a ToolGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig; + + /** + * Verifies a ToolGenerationConfig 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 ToolGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig; + + /** + * Creates a plain object from a ToolGenerationConfig message. Also converts values to other types if specified. + * @param message ToolGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ToolGenerationConfig { + + /** Properties of an OpenApiToolsetGenerationConfig. */ + interface IOpenApiToolsetGenerationConfig { + + /** OpenApiToolsetGenerationConfig uri */ + uri?: (string|null); + + /** OpenApiToolsetGenerationConfig operationGenerationConfigs */ + operationGenerationConfigs?: (google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig[]|null); + } + + /** Represents an OpenApiToolsetGenerationConfig. */ + class OpenApiToolsetGenerationConfig implements IOpenApiToolsetGenerationConfig { + + /** + * Constructs a new OpenApiToolsetGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig); + + /** OpenApiToolsetGenerationConfig uri. */ + public uri: string; + + /** OpenApiToolsetGenerationConfig operationGenerationConfigs. */ + public operationGenerationConfigs: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig[]; + + /** + * Creates a new OpenApiToolsetGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenApiToolsetGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig; + + /** + * Encodes the specified OpenApiToolsetGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.verify|verify} messages. + * @param message OpenApiToolsetGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenApiToolsetGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.verify|verify} messages. + * @param message OpenApiToolsetGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenApiToolsetGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenApiToolsetGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig; + + /** + * Decodes an OpenApiToolsetGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenApiToolsetGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig; + + /** + * Verifies an OpenApiToolsetGenerationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenApiToolsetGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenApiToolsetGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig; + + /** + * Creates a plain object from an OpenApiToolsetGenerationConfig message. Also converts values to other types if specified. + * @param message OpenApiToolsetGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenApiToolsetGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenApiToolsetGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OpenApiToolsetGenerationConfig { + + /** Properties of an OperationGenerationConfig. */ + interface IOperationGenerationConfig { + + /** OperationGenerationConfig method */ + method?: (string|null); + + /** OperationGenerationConfig path */ + path?: (string|null); + + /** OperationGenerationConfig requestJson */ + requestJson?: (string|null); + + /** OperationGenerationConfig responseJson */ + responseJson?: (string|null); + } + + /** Represents an OperationGenerationConfig. */ + class OperationGenerationConfig implements IOperationGenerationConfig { + + /** + * Constructs a new OperationGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig); + + /** OperationGenerationConfig method. */ + public method: string; + + /** OperationGenerationConfig path. */ + public path: string; + + /** OperationGenerationConfig requestJson. */ + public requestJson: string; + + /** OperationGenerationConfig responseJson. */ + public responseJson: string; + + /** + * Creates a new OperationGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig; + + /** + * Encodes the specified OperationGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.verify|verify} messages. + * @param message OperationGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.verify|verify} messages. + * @param message OperationGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig; + + /** + * Decodes an OperationGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig; + + /** + * Verifies an OperationGenerationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig; + + /** + * Creates a plain object from an OperationGenerationConfig message. Also converts values to other types if specified. + * @param message OperationGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an AppGenerationConfig. */ + interface IAppGenerationConfig { + + /** AppGenerationConfig context */ + context?: (string|null); + + /** AppGenerationConfig fileContexts */ + fileContexts?: (google.cloud.ces.v1beta.IFileContext[]|null); + + /** AppGenerationConfig datasetId */ + datasetId?: (string|null); + + /** AppGenerationConfig generateEvaluations */ + generateEvaluations?: (boolean|null); + + /** AppGenerationConfig gcsLocation */ + gcsLocation?: (string|null); + } + + /** Represents an AppGenerationConfig. */ + class AppGenerationConfig implements IAppGenerationConfig { + + /** + * Constructs a new AppGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig); + + /** AppGenerationConfig context. */ + public context: string; + + /** AppGenerationConfig fileContexts. */ + public fileContexts: google.cloud.ces.v1beta.IFileContext[]; + + /** AppGenerationConfig datasetId. */ + public datasetId: string; + + /** AppGenerationConfig generateEvaluations. */ + public generateEvaluations: boolean; + + /** AppGenerationConfig gcsLocation. */ + public gcsLocation: string; + + /** + * Creates a new AppGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AppGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig; + + /** + * Encodes the specified AppGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.verify|verify} messages. + * @param message AppGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.verify|verify} messages. + * @param message AppGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig; + + /** + * Decodes an AppGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig; + + /** + * Verifies an AppGenerationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AppGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig; + + /** + * Creates a plain object from an AppGenerationConfig message. Also converts values to other types if specified. + * @param message AppGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationGenerationConfig. */ + interface IEvaluationGenerationConfig { + + /** EvaluationGenerationConfig datasetId */ + datasetId?: (string|null); + } + + /** Represents an EvaluationGenerationConfig. */ + class EvaluationGenerationConfig implements IEvaluationGenerationConfig { + + /** + * Constructs a new EvaluationGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig); + + /** EvaluationGenerationConfig datasetId. */ + public datasetId: string; + + /** + * Creates a new EvaluationGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig; + + /** + * Encodes the specified EvaluationGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.verify|verify} messages. + * @param message EvaluationGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.verify|verify} messages. + * @param message EvaluationGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig; + + /** + * Decodes an EvaluationGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig; + + /** + * Verifies an EvaluationGenerationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig; + + /** + * Creates a plain object from an EvaluationGenerationConfig message. Also converts values to other types if specified. + * @param message EvaluationGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationPersonasGenerationConfig. */ + interface IEvaluationPersonasGenerationConfig { + } + + /** Represents an EvaluationPersonasGenerationConfig. */ + class EvaluationPersonasGenerationConfig implements IEvaluationPersonasGenerationConfig { + + /** + * Constructs a new EvaluationPersonasGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig); + + /** + * Creates a new EvaluationPersonasGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationPersonasGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig; + + /** + * Encodes the specified EvaluationPersonasGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.verify|verify} messages. + * @param message EvaluationPersonasGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationPersonasGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.verify|verify} messages. + * @param message EvaluationPersonasGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationPersonasGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationPersonasGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig; + + /** + * Decodes an EvaluationPersonasGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationPersonasGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig; + + /** + * Verifies an EvaluationPersonasGenerationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationPersonasGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationPersonasGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig; + + /** + * Creates a plain object from an EvaluationPersonasGenerationConfig message. Also converts values to other types if specified. + * @param message EvaluationPersonasGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationPersonasGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationPersonasGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QualityReportGenerationConfig. */ + interface IQualityReportGenerationConfig { + + /** QualityReportGenerationConfig evaluationRun */ + evaluationRun?: (string|null); + } + + /** Represents a QualityReportGenerationConfig. */ + class QualityReportGenerationConfig implements IQualityReportGenerationConfig { + + /** + * Constructs a new QualityReportGenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig); + + /** QualityReportGenerationConfig evaluationRun. */ + public evaluationRun: string; + + /** + * Creates a new QualityReportGenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QualityReportGenerationConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig; + + /** + * Encodes the specified QualityReportGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.verify|verify} messages. + * @param message QualityReportGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QualityReportGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.verify|verify} messages. + * @param message QualityReportGenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QualityReportGenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QualityReportGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig; + + /** + * Decodes a QualityReportGenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QualityReportGenerationConfig + * @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.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig; + + /** + * Verifies a QualityReportGenerationConfig 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 QualityReportGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QualityReportGenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig; + + /** + * Creates a plain object from a QualityReportGenerationConfig message. Also converts values to other types if specified. + * @param message QualityReportGenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QualityReportGenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QualityReportGenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HillClimbingFixConfig. */ + interface IHillClimbingFixConfig { + + /** HillClimbingFixConfig qualityReport */ + qualityReport?: (google.cloud.ces.v1beta.IQualityReport|null); + } + + /** Represents a HillClimbingFixConfig. */ + class HillClimbingFixConfig implements IHillClimbingFixConfig { + + /** + * Constructs a new HillClimbingFixConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig); + + /** HillClimbingFixConfig qualityReport. */ + public qualityReport?: (google.cloud.ces.v1beta.IQualityReport|null); + + /** + * Creates a new HillClimbingFixConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns HillClimbingFixConfig instance + */ + public static create(properties?: google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig): google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig; + + /** + * Encodes the specified HillClimbingFixConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.verify|verify} messages. + * @param message HillClimbingFixConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HillClimbingFixConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.verify|verify} messages. + * @param message HillClimbingFixConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HillClimbingFixConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HillClimbingFixConfig + * @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.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig; + + /** + * Decodes a HillClimbingFixConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HillClimbingFixConfig + * @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.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig; + + /** + * Verifies a HillClimbingFixConfig 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 HillClimbingFixConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HillClimbingFixConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig; - /** - * Converts this RestoreAppVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a HillClimbingFixConfig message. Also converts values to other types if specified. + * @param message HillClimbingFixConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for RestoreAppVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Converts this HillClimbingFixConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HillClimbingFixConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a GenerateAppResourceResponse. */ @@ -37662,6 +38797,150 @@ export namespace google { } } + /** Properties of a GenerateAppResourceOperationMetadata. */ + interface IGenerateAppResourceOperationMetadata { + + /** GenerateAppResourceOperationMetadata generationType */ + generationType?: (google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType|keyof typeof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType|null); + + /** GenerateAppResourceOperationMetadata message */ + message?: (string|null); + + /** GenerateAppResourceOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GenerateAppResourceOperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** GenerateAppResourceOperationMetadata target */ + target?: (string|null); + + /** GenerateAppResourceOperationMetadata partialErrors */ + partialErrors?: (google.rpc.IStatus[]|null); + } + + /** Represents a GenerateAppResourceOperationMetadata. */ + class GenerateAppResourceOperationMetadata implements IGenerateAppResourceOperationMetadata { + + /** + * Constructs a new GenerateAppResourceOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata); + + /** GenerateAppResourceOperationMetadata generationType. */ + public generationType: (google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType|keyof typeof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType); + + /** GenerateAppResourceOperationMetadata message. */ + public message: string; + + /** GenerateAppResourceOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GenerateAppResourceOperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** GenerateAppResourceOperationMetadata target. */ + public target: string; + + /** GenerateAppResourceOperationMetadata partialErrors. */ + public partialErrors: google.rpc.IStatus[]; + + /** + * Creates a new GenerateAppResourceOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAppResourceOperationMetadata instance + */ + public static create(properties?: google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata): google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata; + + /** + * Encodes the specified GenerateAppResourceOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.verify|verify} messages. + * @param message GenerateAppResourceOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAppResourceOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.verify|verify} messages. + * @param message GenerateAppResourceOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAppResourceOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAppResourceOperationMetadata + * @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.ces.v1beta.GenerateAppResourceOperationMetadata; + + /** + * Decodes a GenerateAppResourceOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAppResourceOperationMetadata + * @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.ces.v1beta.GenerateAppResourceOperationMetadata; + + /** + * Verifies a GenerateAppResourceOperationMetadata 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 GenerateAppResourceOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAppResourceOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata; + + /** + * Creates a plain object from a GenerateAppResourceOperationMetadata message. Also converts values to other types if specified. + * @param message GenerateAppResourceOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAppResourceOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAppResourceOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateAppResourceOperationMetadata { + + /** GenerationType enum. */ + enum GenerationType { + GENERATION_TYPE_UNSPECIFIED = 0, + AGENT_RESTRUCTURE = 1, + AGENT_REFINE = 2, + AGENT_CREATE = 3, + TOOL_CREATE = 4, + SCENARIO_CREATE = 5, + SCENARIO_CREATE_FROM_TRANSCRIPTS = 7, + EVALUATION_PERSONA_CREATE = 6, + QUALITY_REPORT_CREATE = 8, + INSTRUCTION_FOLLOWING_FIX = 9 + } + } + /** Properties of a ListChangelogsRequest. */ interface IListChangelogsRequest { @@ -44305,6 +45584,9 @@ export namespace google { /** AgentTool rootAgent */ rootAgent?: (string|null); + + /** AgentTool agent */ + agent?: (string|null); } /** Represents an AgentTool. */ @@ -44325,6 +45607,9 @@ export namespace google { /** AgentTool rootAgent. */ public rootAgent: string; + /** AgentTool agent. */ + public agent: string; + /** * Creates a new AgentTool instance using the specified properties. * @param [properties] Properties to set @@ -49565,7 +50850,8 @@ export namespace google { SOURCE_UNSPECIFIED = 0, LIVE = 1, SIMULATOR = 2, - EVAL = 3 + EVAL = 3, + AGENT_TOOL = 4 } /** InputType enum. */ @@ -58895,6 +60181,218 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a FileContext. */ + interface IFileContext { + + /** FileContext fileBytes */ + fileBytes?: (google.cloud.ces.v1beta.FileContext.IFileBytes|null); + } + + /** Represents a FileContext. */ + class FileContext implements IFileContext { + + /** + * Constructs a new FileContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.IFileContext); + + /** FileContext fileBytes. */ + public fileBytes?: (google.cloud.ces.v1beta.FileContext.IFileBytes|null); + + /** FileContext file. */ + public file?: "fileBytes"; + + /** + * Creates a new FileContext instance using the specified properties. + * @param [properties] Properties to set + * @returns FileContext instance + */ + public static create(properties?: google.cloud.ces.v1beta.IFileContext): google.cloud.ces.v1beta.FileContext; + + /** + * Encodes the specified FileContext message. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.verify|verify} messages. + * @param message FileContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.IFileContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileContext message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.verify|verify} messages. + * @param message FileContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.IFileContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileContext + * @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.ces.v1beta.FileContext; + + /** + * Decodes a FileContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileContext + * @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.ces.v1beta.FileContext; + + /** + * Verifies a FileContext 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 FileContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.FileContext; + + /** + * Creates a plain object from a FileContext message. Also converts values to other types if specified. + * @param message FileContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.FileContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileContext { + + /** Properties of a FileBytes. */ + interface IFileBytes { + + /** FileBytes fileName */ + fileName?: (string|null); + + /** FileBytes mimeType */ + mimeType?: (string|null); + + /** FileBytes data */ + data?: (Uint8Array|Buffer|string|null); + } + + /** Represents a FileBytes. */ + class FileBytes implements IFileBytes { + + /** + * Constructs a new FileBytes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.ces.v1beta.FileContext.IFileBytes); + + /** FileBytes fileName. */ + public fileName: string; + + /** FileBytes mimeType. */ + public mimeType: string; + + /** FileBytes data. */ + public data: (Uint8Array|Buffer|string); + + /** + * Creates a new FileBytes instance using the specified properties. + * @param [properties] Properties to set + * @returns FileBytes instance + */ + public static create(properties?: google.cloud.ces.v1beta.FileContext.IFileBytes): google.cloud.ces.v1beta.FileContext.FileBytes; + + /** + * Encodes the specified FileBytes message. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.FileBytes.verify|verify} messages. + * @param message FileBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.ces.v1beta.FileContext.IFileBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileBytes message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.FileBytes.verify|verify} messages. + * @param message FileBytes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.ces.v1beta.FileContext.IFileBytes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileBytes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileBytes + * @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.ces.v1beta.FileContext.FileBytes; + + /** + * Decodes a FileBytes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileBytes + * @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.ces.v1beta.FileContext.FileBytes; + + /** + * Verifies a FileBytes 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 FileBytes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileBytes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.ces.v1beta.FileContext.FileBytes; + + /** + * Creates a plain object from a FileBytes message. Also converts values to other types if specified. + * @param message FileBytes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.ces.v1beta.FileContext.FileBytes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileBytes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileBytes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a SecuritySettings. */ interface ISecuritySettings { diff --git a/packages/google-cloud-ces/protos/protos.js b/packages/google-cloud-ces/protos/protos.js index caf62dc3e39..08ed6fd185a 100644 --- a/packages/google-cloud-ces/protos/protos.js +++ b/packages/google-cloud-ces/protos/protos.js @@ -75112,6 +75112,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.ces.v1beta.AgentService|generateAppResource}. + * @memberof google.cloud.ces.v1beta.AgentService + * @typedef GenerateAppResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GenerateAppResource. + * @function generateAppResource + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateAppResourceRequest} request GenerateAppResourceRequest message or plain object + * @param {google.cloud.ces.v1beta.AgentService.GenerateAppResourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AgentService.prototype.generateAppResource = function generateAppResource(request, callback) { + return this.rpcCall(generateAppResource, $root.google.cloud.ces.v1beta.GenerateAppResourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GenerateAppResource" }); + + /** + * Calls GenerateAppResource. + * @function generateAppResource + * @memberof google.cloud.ces.v1beta.AgentService + * @instance + * @param {google.cloud.ces.v1beta.IGenerateAppResourceRequest} request GenerateAppResourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.ces.v1beta.AgentService|listChangelogs}. * @memberof google.cloud.ces.v1beta.AgentService @@ -83141,6 +83174,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.sources != null && message.hasOwnProperty("sources")) { @@ -83154,6 +83188,7 @@ case 1: case 2: case 3: + case 4: break; } } @@ -83203,6 +83238,10 @@ case 3: message.source = 3; break; + case "AGENT_TOOL": + case 4: + message.source = 4; + break; } if (object.sources) { if (!Array.isArray(object.sources)) @@ -83231,6 +83270,10 @@ case 3: message.sources[i] = 3; break; + case "AGENT_TOOL": + case 4: + message.sources[i] = 4; + break; } } return message; @@ -83714,6 +83757,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -83756,6 +83800,10 @@ case 3: message.source = 3; break; + case "AGENT_TOOL": + case 4: + message.source = 4; + break; } return message; }; @@ -83972,6 +84020,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -84014,6 +84063,10 @@ case 3: message.source = 3; break; + case "AGENT_TOOL": + case 4: + message.source = 4; + break; } return message; }; @@ -90694,6 +90747,2772 @@ return RestoreAppVersionResponse; })(); + v1beta.GenerateAppResourceRequest = (function() { + + /** + * Properties of a GenerateAppResourceRequest. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateAppResourceRequest + * @property {google.cloud.ces.v1beta.IAgent|null} [agent] GenerateAppResourceRequest agent + * @property {google.cloud.ces.v1beta.ITool|null} [tool] GenerateAppResourceRequest tool + * @property {google.cloud.ces.v1beta.IToolset|null} [toolset] GenerateAppResourceRequest toolset + * @property {string|null} [parent] GenerateAppResourceRequest parent + * @property {Array.|null} [refineInstructions] GenerateAppResourceRequest refineInstructions + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig|null} [toolGenerationConfig] GenerateAppResourceRequest toolGenerationConfig + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig|null} [appGenerationConfig] GenerateAppResourceRequest appGenerationConfig + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig|null} [evaluationGenerationConfig] GenerateAppResourceRequest evaluationGenerationConfig + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig|null} [evaluationPersonasGenerationConfig] GenerateAppResourceRequest evaluationPersonasGenerationConfig + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig|null} [qualityReportGenerationConfig] GenerateAppResourceRequest qualityReportGenerationConfig + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig|null} [hillClimbingFixConfig] GenerateAppResourceRequest hillClimbingFixConfig + */ + + /** + * Constructs a new GenerateAppResourceRequest. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateAppResourceRequest. + * @implements IGenerateAppResourceRequest + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateAppResourceRequest=} [properties] Properties to set + */ + function GenerateAppResourceRequest(properties) { + this.refineInstructions = []; + 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]]; + } + + /** + * GenerateAppResourceRequest agent. + * @member {google.cloud.ces.v1beta.IAgent|null|undefined} agent + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.agent = null; + + /** + * GenerateAppResourceRequest tool. + * @member {google.cloud.ces.v1beta.ITool|null|undefined} tool + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.tool = null; + + /** + * GenerateAppResourceRequest toolset. + * @member {google.cloud.ces.v1beta.IToolset|null|undefined} toolset + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.toolset = null; + + /** + * GenerateAppResourceRequest parent. + * @member {string} parent + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.parent = ""; + + /** + * GenerateAppResourceRequest refineInstructions. + * @member {Array.} refineInstructions + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.refineInstructions = $util.emptyArray; + + /** + * GenerateAppResourceRequest toolGenerationConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig|null|undefined} toolGenerationConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.toolGenerationConfig = null; + + /** + * GenerateAppResourceRequest appGenerationConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig|null|undefined} appGenerationConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.appGenerationConfig = null; + + /** + * GenerateAppResourceRequest evaluationGenerationConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig|null|undefined} evaluationGenerationConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.evaluationGenerationConfig = null; + + /** + * GenerateAppResourceRequest evaluationPersonasGenerationConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig|null|undefined} evaluationPersonasGenerationConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.evaluationPersonasGenerationConfig = null; + + /** + * GenerateAppResourceRequest qualityReportGenerationConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig|null|undefined} qualityReportGenerationConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.qualityReportGenerationConfig = null; + + /** + * GenerateAppResourceRequest hillClimbingFixConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig|null|undefined} hillClimbingFixConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + GenerateAppResourceRequest.prototype.hillClimbingFixConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateAppResourceRequest resource. + * @member {"agent"|"tool"|"toolset"|undefined} resource + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + */ + Object.defineProperty(GenerateAppResourceRequest.prototype, "resource", { + get: $util.oneOfGetter($oneOfFields = ["agent", "tool", "toolset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateAppResourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceRequest=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest} GenerateAppResourceRequest instance + */ + GenerateAppResourceRequest.create = function create(properties) { + return new GenerateAppResourceRequest(properties); + }; + + /** + * Encodes the specified GenerateAppResourceRequest message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceRequest} message GenerateAppResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceRequest.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.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.ces.v1beta.Agent.encode(message.agent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.refineInstructions != null && message.refineInstructions.length) + for (var i = 0; i < message.refineInstructions.length; ++i) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.encode(message.refineInstructions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tool != null && Object.hasOwnProperty.call(message, "tool")) + $root.google.cloud.ces.v1beta.Tool.encode(message.tool, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.toolGenerationConfig != null && Object.hasOwnProperty.call(message, "toolGenerationConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.encode(message.toolGenerationConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.toolset != null && Object.hasOwnProperty.call(message, "toolset")) + $root.google.cloud.ces.v1beta.Toolset.encode(message.toolset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appGenerationConfig != null && Object.hasOwnProperty.call(message, "appGenerationConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.encode(message.appGenerationConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.evaluationGenerationConfig != null && Object.hasOwnProperty.call(message, "evaluationGenerationConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.encode(message.evaluationGenerationConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.evaluationPersonasGenerationConfig != null && Object.hasOwnProperty.call(message, "evaluationPersonasGenerationConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.encode(message.evaluationPersonasGenerationConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.qualityReportGenerationConfig != null && Object.hasOwnProperty.call(message, "qualityReportGenerationConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.encode(message.qualityReportGenerationConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.hillClimbingFixConfig != null && Object.hasOwnProperty.call(message, "hillClimbingFixConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.encode(message.hillClimbingFixConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAppResourceRequest message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceRequest} message GenerateAppResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAppResourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest} GenerateAppResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.agent = $root.google.cloud.ces.v1beta.Agent.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tool = $root.google.cloud.ces.v1beta.Tool.decode(reader, reader.uint32()); + break; + } + case 6: { + message.toolset = $root.google.cloud.ces.v1beta.Toolset.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + if (!(message.refineInstructions && message.refineInstructions.length)) + message.refineInstructions = []; + message.refineInstructions.push($root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.decode(reader, reader.uint32())); + break; + } + case 5: { + message.toolGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.appGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.evaluationGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.evaluationPersonasGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.qualityReportGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.hillClimbingFixConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAppResourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest} GenerateAppResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAppResourceRequest message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAppResourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.agent != null && message.hasOwnProperty("agent")) { + properties.resource = 1; + { + var error = $root.google.cloud.ces.v1beta.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + } + if (message.tool != null && message.hasOwnProperty("tool")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.ces.v1beta.Tool.verify(message.tool); + if (error) + return "tool." + error; + } + } + if (message.toolset != null && message.hasOwnProperty("toolset")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.cloud.ces.v1beta.Toolset.verify(message.toolset); + if (error) + return "toolset." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.refineInstructions != null && message.hasOwnProperty("refineInstructions")) { + if (!Array.isArray(message.refineInstructions)) + return "refineInstructions: array expected"; + for (var i = 0; i < message.refineInstructions.length; ++i) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.verify(message.refineInstructions[i]); + if (error) + return "refineInstructions." + error; + } + } + if (message.toolGenerationConfig != null && message.hasOwnProperty("toolGenerationConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.verify(message.toolGenerationConfig); + if (error) + return "toolGenerationConfig." + error; + } + if (message.appGenerationConfig != null && message.hasOwnProperty("appGenerationConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.verify(message.appGenerationConfig); + if (error) + return "appGenerationConfig." + error; + } + if (message.evaluationGenerationConfig != null && message.hasOwnProperty("evaluationGenerationConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.verify(message.evaluationGenerationConfig); + if (error) + return "evaluationGenerationConfig." + error; + } + if (message.evaluationPersonasGenerationConfig != null && message.hasOwnProperty("evaluationPersonasGenerationConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.verify(message.evaluationPersonasGenerationConfig); + if (error) + return "evaluationPersonasGenerationConfig." + error; + } + if (message.qualityReportGenerationConfig != null && message.hasOwnProperty("qualityReportGenerationConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.verify(message.qualityReportGenerationConfig); + if (error) + return "qualityReportGenerationConfig." + error; + } + if (message.hillClimbingFixConfig != null && message.hasOwnProperty("hillClimbingFixConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.verify(message.hillClimbingFixConfig); + if (error) + return "hillClimbingFixConfig." + error; + } + return null; + }; + + /** + * Creates a GenerateAppResourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest} GenerateAppResourceRequest + */ + GenerateAppResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.agent: object expected"); + message.agent = $root.google.cloud.ces.v1beta.Agent.fromObject(object.agent); + } + if (object.tool != null) { + if (typeof object.tool !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.tool: object expected"); + message.tool = $root.google.cloud.ces.v1beta.Tool.fromObject(object.tool); + } + if (object.toolset != null) { + if (typeof object.toolset !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.toolset: object expected"); + message.toolset = $root.google.cloud.ces.v1beta.Toolset.fromObject(object.toolset); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.refineInstructions) { + if (!Array.isArray(object.refineInstructions)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.refineInstructions: array expected"); + message.refineInstructions = []; + for (var i = 0; i < object.refineInstructions.length; ++i) { + if (typeof object.refineInstructions[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.refineInstructions: object expected"); + message.refineInstructions[i] = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.fromObject(object.refineInstructions[i]); + } + } + if (object.toolGenerationConfig != null) { + if (typeof object.toolGenerationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.toolGenerationConfig: object expected"); + message.toolGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.fromObject(object.toolGenerationConfig); + } + if (object.appGenerationConfig != null) { + if (typeof object.appGenerationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.appGenerationConfig: object expected"); + message.appGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.fromObject(object.appGenerationConfig); + } + if (object.evaluationGenerationConfig != null) { + if (typeof object.evaluationGenerationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.evaluationGenerationConfig: object expected"); + message.evaluationGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.fromObject(object.evaluationGenerationConfig); + } + if (object.evaluationPersonasGenerationConfig != null) { + if (typeof object.evaluationPersonasGenerationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.evaluationPersonasGenerationConfig: object expected"); + message.evaluationPersonasGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.fromObject(object.evaluationPersonasGenerationConfig); + } + if (object.qualityReportGenerationConfig != null) { + if (typeof object.qualityReportGenerationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.qualityReportGenerationConfig: object expected"); + message.qualityReportGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.fromObject(object.qualityReportGenerationConfig); + } + if (object.hillClimbingFixConfig != null) { + if (typeof object.hillClimbingFixConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.hillClimbingFixConfig: object expected"); + message.hillClimbingFixConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.fromObject(object.hillClimbingFixConfig); + } + return message; + }; + + /** + * Creates a plain object from a GenerateAppResourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest} message GenerateAppResourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAppResourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.refineInstructions = []; + if (options.defaults) { + object.parent = ""; + object.toolGenerationConfig = null; + object.appGenerationConfig = null; + object.evaluationGenerationConfig = null; + object.evaluationPersonasGenerationConfig = null; + object.qualityReportGenerationConfig = null; + object.hillClimbingFixConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agent != null && message.hasOwnProperty("agent")) { + object.agent = $root.google.cloud.ces.v1beta.Agent.toObject(message.agent, options); + if (options.oneofs) + object.resource = "agent"; + } + if (message.refineInstructions && message.refineInstructions.length) { + object.refineInstructions = []; + for (var j = 0; j < message.refineInstructions.length; ++j) + object.refineInstructions[j] = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.toObject(message.refineInstructions[j], options); + } + if (message.tool != null && message.hasOwnProperty("tool")) { + object.tool = $root.google.cloud.ces.v1beta.Tool.toObject(message.tool, options); + if (options.oneofs) + object.resource = "tool"; + } + if (message.toolGenerationConfig != null && message.hasOwnProperty("toolGenerationConfig")) + object.toolGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.toObject(message.toolGenerationConfig, options); + if (message.toolset != null && message.hasOwnProperty("toolset")) { + object.toolset = $root.google.cloud.ces.v1beta.Toolset.toObject(message.toolset, options); + if (options.oneofs) + object.resource = "toolset"; + } + if (message.appGenerationConfig != null && message.hasOwnProperty("appGenerationConfig")) + object.appGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.toObject(message.appGenerationConfig, options); + if (message.evaluationGenerationConfig != null && message.hasOwnProperty("evaluationGenerationConfig")) + object.evaluationGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.toObject(message.evaluationGenerationConfig, options); + if (message.evaluationPersonasGenerationConfig != null && message.hasOwnProperty("evaluationPersonasGenerationConfig")) + object.evaluationPersonasGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.toObject(message.evaluationPersonasGenerationConfig, options); + if (message.qualityReportGenerationConfig != null && message.hasOwnProperty("qualityReportGenerationConfig")) + object.qualityReportGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.toObject(message.qualityReportGenerationConfig, options); + if (message.hillClimbingFixConfig != null && message.hasOwnProperty("hillClimbingFixConfig")) + object.hillClimbingFixConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.toObject(message.hillClimbingFixConfig, options); + return object; + }; + + /** + * Converts this GenerateAppResourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateAppResourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAppResourceRequest + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAppResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest"; + }; + + GenerateAppResourceRequest.RefineInstructions = (function() { + + /** + * Properties of a RefineInstructions. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IRefineInstructions + * @property {number|Long|null} [startIndex] RefineInstructions startIndex + * @property {number|Long|null} [endIndex] RefineInstructions endIndex + * @property {google.protobuf.IFieldMask|null} [fieldMask] RefineInstructions fieldMask + * @property {string|null} [instructions] RefineInstructions instructions + */ + + /** + * Constructs a new RefineInstructions. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents a RefineInstructions. + * @implements IRefineInstructions + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions=} [properties] Properties to set + */ + function RefineInstructions(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]]; + } + + /** + * RefineInstructions startIndex. + * @member {number|Long} startIndex + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @instance + */ + RefineInstructions.prototype.startIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RefineInstructions endIndex. + * @member {number|Long} endIndex + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @instance + */ + RefineInstructions.prototype.endIndex = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RefineInstructions fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @instance + */ + RefineInstructions.prototype.fieldMask = null; + + /** + * RefineInstructions instructions. + * @member {string} instructions + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @instance + */ + RefineInstructions.prototype.instructions = ""; + + /** + * Creates a new RefineInstructions instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions} RefineInstructions instance + */ + RefineInstructions.create = function create(properties) { + return new RefineInstructions(properties); + }; + + /** + * Encodes the specified RefineInstructions message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions} message RefineInstructions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefineInstructions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startIndex); + if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endIndex); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.instructions != null && Object.hasOwnProperty.call(message, "instructions")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.instructions); + return writer; + }; + + /** + * Encodes the specified RefineInstructions message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IRefineInstructions} message RefineInstructions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefineInstructions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RefineInstructions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions} RefineInstructions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefineInstructions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int64(); + break; + } + case 2: { + message.endIndex = reader.int64(); + break; + } + case 3: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.instructions = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RefineInstructions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions} RefineInstructions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefineInstructions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RefineInstructions message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RefineInstructions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + if (!$util.isInteger(message.startIndex) && !(message.startIndex && $util.isInteger(message.startIndex.low) && $util.isInteger(message.startIndex.high))) + return "startIndex: integer|Long expected"; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) + if (!$util.isInteger(message.endIndex) && !(message.endIndex && $util.isInteger(message.endIndex.low) && $util.isInteger(message.endIndex.high))) + return "endIndex: integer|Long expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.instructions != null && message.hasOwnProperty("instructions")) + if (!$util.isString(message.instructions)) + return "instructions: string expected"; + return null; + }; + + /** + * Creates a RefineInstructions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions} RefineInstructions + */ + RefineInstructions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions(); + if (object.startIndex != null) + if ($util.Long) + (message.startIndex = $util.Long.fromValue(object.startIndex)).unsigned = false; + else if (typeof object.startIndex === "string") + message.startIndex = parseInt(object.startIndex, 10); + else if (typeof object.startIndex === "number") + message.startIndex = object.startIndex; + else if (typeof object.startIndex === "object") + message.startIndex = new $util.LongBits(object.startIndex.low >>> 0, object.startIndex.high >>> 0).toNumber(); + if (object.endIndex != null) + if ($util.Long) + (message.endIndex = $util.Long.fromValue(object.endIndex)).unsigned = false; + else if (typeof object.endIndex === "string") + message.endIndex = parseInt(object.endIndex, 10); + else if (typeof object.endIndex === "number") + message.endIndex = object.endIndex; + else if (typeof object.endIndex === "object") + message.endIndex = new $util.LongBits(object.endIndex.low >>> 0, object.endIndex.high >>> 0).toNumber(); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.instructions != null) + message.instructions = String(object.instructions); + return message; + }; + + /** + * Creates a plain object from a RefineInstructions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions} message RefineInstructions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RefineInstructions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startIndex = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endIndex = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endIndex = options.longs === String ? "0" : 0; + object.fieldMask = null; + object.instructions = ""; + } + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + if (typeof message.startIndex === "number") + object.startIndex = options.longs === String ? String(message.startIndex) : message.startIndex; + else + object.startIndex = options.longs === String ? $util.Long.prototype.toString.call(message.startIndex) : options.longs === Number ? new $util.LongBits(message.startIndex.low >>> 0, message.startIndex.high >>> 0).toNumber() : message.startIndex; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) + if (typeof message.endIndex === "number") + object.endIndex = options.longs === String ? String(message.endIndex) : message.endIndex; + else + object.endIndex = options.longs === String ? $util.Long.prototype.toString.call(message.endIndex) : options.longs === Number ? new $util.LongBits(message.endIndex.low >>> 0, message.endIndex.high >>> 0).toNumber() : message.endIndex; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.instructions != null && message.hasOwnProperty("instructions")) + object.instructions = message.instructions; + return object; + }; + + /** + * Converts this RefineInstructions to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @instance + * @returns {Object.} JSON object + */ + RefineInstructions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RefineInstructions + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RefineInstructions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.RefineInstructions"; + }; + + return RefineInstructions; + })(); + + GenerateAppResourceRequest.ToolGenerationConfig = (function() { + + /** + * Properties of a ToolGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IToolGenerationConfig + * @property {string|null} [context] ToolGenerationConfig context + * @property {Array.|null} [fileContexts] ToolGenerationConfig fileContexts + * @property {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig|null} [openApiToolsetGenerationConfig] ToolGenerationConfig openApiToolsetGenerationConfig + */ + + /** + * Constructs a new ToolGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents a ToolGenerationConfig. + * @implements IToolGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig=} [properties] Properties to set + */ + function ToolGenerationConfig(properties) { + this.fileContexts = []; + 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]]; + } + + /** + * ToolGenerationConfig context. + * @member {string} context + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @instance + */ + ToolGenerationConfig.prototype.context = ""; + + /** + * ToolGenerationConfig fileContexts. + * @member {Array.} fileContexts + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @instance + */ + ToolGenerationConfig.prototype.fileContexts = $util.emptyArray; + + /** + * ToolGenerationConfig openApiToolsetGenerationConfig. + * @member {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig|null|undefined} openApiToolsetGenerationConfig + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @instance + */ + ToolGenerationConfig.prototype.openApiToolsetGenerationConfig = null; + + /** + * Creates a new ToolGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig} ToolGenerationConfig instance + */ + ToolGenerationConfig.create = function create(properties) { + return new ToolGenerationConfig(properties); + }; + + /** + * Encodes the specified ToolGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig} message ToolGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.context); + if (message.openApiToolsetGenerationConfig != null && Object.hasOwnProperty.call(message, "openApiToolsetGenerationConfig")) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.encode(message.openApiToolsetGenerationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fileContexts != null && message.fileContexts.length) + for (var i = 0; i < message.fileContexts.length; ++i) + $root.google.cloud.ces.v1beta.FileContext.encode(message.fileContexts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IToolGenerationConfig} message ToolGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig} ToolGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.context = reader.string(); + break; + } + case 3: { + if (!(message.fileContexts && message.fileContexts.length)) + message.fileContexts = []; + message.fileContexts.push($root.google.cloud.ces.v1beta.FileContext.decode(reader, reader.uint32())); + break; + } + case 2: { + message.openApiToolsetGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig} ToolGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) + if (!$util.isString(message.context)) + return "context: string expected"; + if (message.fileContexts != null && message.hasOwnProperty("fileContexts")) { + if (!Array.isArray(message.fileContexts)) + return "fileContexts: array expected"; + for (var i = 0; i < message.fileContexts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.FileContext.verify(message.fileContexts[i]); + if (error) + return "fileContexts." + error; + } + } + if (message.openApiToolsetGenerationConfig != null && message.hasOwnProperty("openApiToolsetGenerationConfig")) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.verify(message.openApiToolsetGenerationConfig); + if (error) + return "openApiToolsetGenerationConfig." + error; + } + return null; + }; + + /** + * Creates a ToolGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig} ToolGenerationConfig + */ + ToolGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig(); + if (object.context != null) + message.context = String(object.context); + if (object.fileContexts) { + if (!Array.isArray(object.fileContexts)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.fileContexts: array expected"); + message.fileContexts = []; + for (var i = 0; i < object.fileContexts.length; ++i) { + if (typeof object.fileContexts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.fileContexts: object expected"); + message.fileContexts[i] = $root.google.cloud.ces.v1beta.FileContext.fromObject(object.fileContexts[i]); + } + } + if (object.openApiToolsetGenerationConfig != null) { + if (typeof object.openApiToolsetGenerationConfig !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.openApiToolsetGenerationConfig: object expected"); + message.openApiToolsetGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.fromObject(object.openApiToolsetGenerationConfig); + } + return message; + }; + + /** + * Creates a plain object from a ToolGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig} message ToolGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolGenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fileContexts = []; + if (options.defaults) { + object.context = ""; + object.openApiToolsetGenerationConfig = null; + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = message.context; + if (message.openApiToolsetGenerationConfig != null && message.hasOwnProperty("openApiToolsetGenerationConfig")) + object.openApiToolsetGenerationConfig = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.toObject(message.openApiToolsetGenerationConfig, options); + if (message.fileContexts && message.fileContexts.length) { + object.fileContexts = []; + for (var j = 0; j < message.fileContexts.length; ++j) + object.fileContexts[j] = $root.google.cloud.ces.v1beta.FileContext.toObject(message.fileContexts[j], options); + } + return object; + }; + + /** + * Converts this ToolGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + ToolGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig"; + }; + + ToolGenerationConfig.OpenApiToolsetGenerationConfig = (function() { + + /** + * Properties of an OpenApiToolsetGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @interface IOpenApiToolsetGenerationConfig + * @property {string|null} [uri] OpenApiToolsetGenerationConfig uri + * @property {Array.|null} [operationGenerationConfigs] OpenApiToolsetGenerationConfig operationGenerationConfigs + */ + + /** + * Constructs a new OpenApiToolsetGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig + * @classdesc Represents an OpenApiToolsetGenerationConfig. + * @implements IOpenApiToolsetGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig=} [properties] Properties to set + */ + function OpenApiToolsetGenerationConfig(properties) { + this.operationGenerationConfigs = []; + 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]]; + } + + /** + * OpenApiToolsetGenerationConfig uri. + * @member {string} uri + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @instance + */ + OpenApiToolsetGenerationConfig.prototype.uri = ""; + + /** + * OpenApiToolsetGenerationConfig operationGenerationConfigs. + * @member {Array.} operationGenerationConfigs + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @instance + */ + OpenApiToolsetGenerationConfig.prototype.operationGenerationConfigs = $util.emptyArray; + + /** + * Creates a new OpenApiToolsetGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig} OpenApiToolsetGenerationConfig instance + */ + OpenApiToolsetGenerationConfig.create = function create(properties) { + return new OpenApiToolsetGenerationConfig(properties); + }; + + /** + * Encodes the specified OpenApiToolsetGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig} message OpenApiToolsetGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolsetGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.operationGenerationConfigs != null && message.operationGenerationConfigs.length) + for (var i = 0; i < message.operationGenerationConfigs.length; ++i) + $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.encode(message.operationGenerationConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OpenApiToolsetGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.IOpenApiToolsetGenerationConfig} message OpenApiToolsetGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenApiToolsetGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenApiToolsetGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig} OpenApiToolsetGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolsetGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + if (!(message.operationGenerationConfigs && message.operationGenerationConfigs.length)) + message.operationGenerationConfigs = []; + message.operationGenerationConfigs.push($root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenApiToolsetGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig} OpenApiToolsetGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenApiToolsetGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenApiToolsetGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenApiToolsetGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.operationGenerationConfigs != null && message.hasOwnProperty("operationGenerationConfigs")) { + if (!Array.isArray(message.operationGenerationConfigs)) + return "operationGenerationConfigs: array expected"; + for (var i = 0; i < message.operationGenerationConfigs.length; ++i) { + var error = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.verify(message.operationGenerationConfigs[i]); + if (error) + return "operationGenerationConfigs." + error; + } + } + return null; + }; + + /** + * Creates an OpenApiToolsetGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig} OpenApiToolsetGenerationConfig + */ + OpenApiToolsetGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.operationGenerationConfigs) { + if (!Array.isArray(object.operationGenerationConfigs)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.operationGenerationConfigs: array expected"); + message.operationGenerationConfigs = []; + for (var i = 0; i < object.operationGenerationConfigs.length; ++i) { + if (typeof object.operationGenerationConfigs[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.operationGenerationConfigs: object expected"); + message.operationGenerationConfigs[i] = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.fromObject(object.operationGenerationConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OpenApiToolsetGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig} message OpenApiToolsetGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenApiToolsetGenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operationGenerationConfigs = []; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.operationGenerationConfigs && message.operationGenerationConfigs.length) { + object.operationGenerationConfigs = []; + for (var j = 0; j < message.operationGenerationConfigs.length; ++j) + object.operationGenerationConfigs[j] = $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.toObject(message.operationGenerationConfigs[j], options); + } + return object; + }; + + /** + * Converts this OpenApiToolsetGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + OpenApiToolsetGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenApiToolsetGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenApiToolsetGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig"; + }; + + OpenApiToolsetGenerationConfig.OperationGenerationConfig = (function() { + + /** + * Properties of an OperationGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @interface IOperationGenerationConfig + * @property {string|null} [method] OperationGenerationConfig method + * @property {string|null} [path] OperationGenerationConfig path + * @property {string|null} [requestJson] OperationGenerationConfig requestJson + * @property {string|null} [responseJson] OperationGenerationConfig responseJson + */ + + /** + * Constructs a new OperationGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig + * @classdesc Represents an OperationGenerationConfig. + * @implements IOperationGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig=} [properties] Properties to set + */ + function OperationGenerationConfig(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]]; + } + + /** + * OperationGenerationConfig method. + * @member {string} method + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @instance + */ + OperationGenerationConfig.prototype.method = ""; + + /** + * OperationGenerationConfig path. + * @member {string} path + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @instance + */ + OperationGenerationConfig.prototype.path = ""; + + /** + * OperationGenerationConfig requestJson. + * @member {string} requestJson + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @instance + */ + OperationGenerationConfig.prototype.requestJson = ""; + + /** + * OperationGenerationConfig responseJson. + * @member {string} responseJson + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @instance + */ + OperationGenerationConfig.prototype.responseJson = ""; + + /** + * Creates a new OperationGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig} OperationGenerationConfig instance + */ + OperationGenerationConfig.create = function create(properties) { + return new OperationGenerationConfig(properties); + }; + + /** + * Encodes the specified OperationGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig} message OperationGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.method); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.requestJson != null && Object.hasOwnProperty.call(message, "requestJson")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestJson); + if (message.responseJson != null && Object.hasOwnProperty.call(message, "responseJson")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.responseJson); + return writer; + }; + + /** + * Encodes the specified OperationGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.IOperationGenerationConfig} message OperationGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig} OperationGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.method = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + case 3: { + message.requestJson = reader.string(); + break; + } + case 4: { + message.responseJson = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig} OperationGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.method != null && message.hasOwnProperty("method")) + if (!$util.isString(message.method)) + return "method: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.requestJson != null && message.hasOwnProperty("requestJson")) + if (!$util.isString(message.requestJson)) + return "requestJson: string expected"; + if (message.responseJson != null && message.hasOwnProperty("responseJson")) + if (!$util.isString(message.responseJson)) + return "responseJson: string expected"; + return null; + }; + + /** + * Creates an OperationGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig} OperationGenerationConfig + */ + OperationGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig(); + if (object.method != null) + message.method = String(object.method); + if (object.path != null) + message.path = String(object.path); + if (object.requestJson != null) + message.requestJson = String(object.requestJson); + if (object.responseJson != null) + message.responseJson = String(object.responseJson); + return message; + }; + + /** + * Creates a plain object from an OperationGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig} message OperationGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationGenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.method = ""; + object.path = ""; + object.requestJson = ""; + object.responseJson = ""; + } + if (message.method != null && message.hasOwnProperty("method")) + object.method = message.method; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.requestJson != null && message.hasOwnProperty("requestJson")) + object.requestJson = message.requestJson; + if (message.responseJson != null && message.hasOwnProperty("responseJson")) + object.responseJson = message.responseJson; + return object; + }; + + /** + * Converts this OperationGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + OperationGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig.OpenApiToolsetGenerationConfig.OperationGenerationConfig"; + }; + + return OperationGenerationConfig; + })(); + + return OpenApiToolsetGenerationConfig; + })(); + + return ToolGenerationConfig; + })(); + + GenerateAppResourceRequest.AppGenerationConfig = (function() { + + /** + * Properties of an AppGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IAppGenerationConfig + * @property {string|null} [context] AppGenerationConfig context + * @property {Array.|null} [fileContexts] AppGenerationConfig fileContexts + * @property {string|null} [datasetId] AppGenerationConfig datasetId + * @property {boolean|null} [generateEvaluations] AppGenerationConfig generateEvaluations + * @property {string|null} [gcsLocation] AppGenerationConfig gcsLocation + */ + + /** + * Constructs a new AppGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents an AppGenerationConfig. + * @implements IAppGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig=} [properties] Properties to set + */ + function AppGenerationConfig(properties) { + this.fileContexts = []; + 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]]; + } + + /** + * AppGenerationConfig context. + * @member {string} context + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @instance + */ + AppGenerationConfig.prototype.context = ""; + + /** + * AppGenerationConfig fileContexts. + * @member {Array.} fileContexts + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @instance + */ + AppGenerationConfig.prototype.fileContexts = $util.emptyArray; + + /** + * AppGenerationConfig datasetId. + * @member {string} datasetId + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @instance + */ + AppGenerationConfig.prototype.datasetId = ""; + + /** + * AppGenerationConfig generateEvaluations. + * @member {boolean} generateEvaluations + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @instance + */ + AppGenerationConfig.prototype.generateEvaluations = false; + + /** + * AppGenerationConfig gcsLocation. + * @member {string} gcsLocation + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @instance + */ + AppGenerationConfig.prototype.gcsLocation = ""; + + /** + * Creates a new AppGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig} AppGenerationConfig instance + */ + AppGenerationConfig.create = function create(properties) { + return new AppGenerationConfig(properties); + }; + + /** + * Encodes the specified AppGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig} message AppGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.context); + if (message.fileContexts != null && message.fileContexts.length) + for (var i = 0; i < message.fileContexts.length; ++i) + $root.google.cloud.ces.v1beta.FileContext.encode(message.fileContexts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); + if (message.generateEvaluations != null && Object.hasOwnProperty.call(message, "generateEvaluations")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.generateEvaluations); + if (message.gcsLocation != null && Object.hasOwnProperty.call(message, "gcsLocation")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcsLocation); + return writer; + }; + + /** + * Encodes the specified AppGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IAppGenerationConfig} message AppGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig} AppGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.context = reader.string(); + break; + } + case 2: { + if (!(message.fileContexts && message.fileContexts.length)) + message.fileContexts = []; + message.fileContexts.push($root.google.cloud.ces.v1beta.FileContext.decode(reader, reader.uint32())); + break; + } + case 3: { + message.datasetId = reader.string(); + break; + } + case 4: { + message.generateEvaluations = reader.bool(); + break; + } + case 5: { + message.gcsLocation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig} AppGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) + if (!$util.isString(message.context)) + return "context: string expected"; + if (message.fileContexts != null && message.hasOwnProperty("fileContexts")) { + if (!Array.isArray(message.fileContexts)) + return "fileContexts: array expected"; + for (var i = 0; i < message.fileContexts.length; ++i) { + var error = $root.google.cloud.ces.v1beta.FileContext.verify(message.fileContexts[i]); + if (error) + return "fileContexts." + error; + } + } + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.generateEvaluations != null && message.hasOwnProperty("generateEvaluations")) + if (typeof message.generateEvaluations !== "boolean") + return "generateEvaluations: boolean expected"; + if (message.gcsLocation != null && message.hasOwnProperty("gcsLocation")) + if (!$util.isString(message.gcsLocation)) + return "gcsLocation: string expected"; + return null; + }; + + /** + * Creates an AppGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig} AppGenerationConfig + */ + AppGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig(); + if (object.context != null) + message.context = String(object.context); + if (object.fileContexts) { + if (!Array.isArray(object.fileContexts)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.fileContexts: array expected"); + message.fileContexts = []; + for (var i = 0; i < object.fileContexts.length; ++i) { + if (typeof object.fileContexts[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig.fileContexts: object expected"); + message.fileContexts[i] = $root.google.cloud.ces.v1beta.FileContext.fromObject(object.fileContexts[i]); + } + } + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.generateEvaluations != null) + message.generateEvaluations = Boolean(object.generateEvaluations); + if (object.gcsLocation != null) + message.gcsLocation = String(object.gcsLocation); + return message; + }; + + /** + * Creates a plain object from an AppGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig} message AppGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppGenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fileContexts = []; + if (options.defaults) { + object.context = ""; + object.datasetId = ""; + object.generateEvaluations = false; + object.gcsLocation = ""; + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = message.context; + if (message.fileContexts && message.fileContexts.length) { + object.fileContexts = []; + for (var j = 0; j < message.fileContexts.length; ++j) + object.fileContexts[j] = $root.google.cloud.ces.v1beta.FileContext.toObject(message.fileContexts[j], options); + } + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.generateEvaluations != null && message.hasOwnProperty("generateEvaluations")) + object.generateEvaluations = message.generateEvaluations; + if (message.gcsLocation != null && message.hasOwnProperty("gcsLocation")) + object.gcsLocation = message.gcsLocation; + return object; + }; + + /** + * Converts this AppGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + AppGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig"; + }; + + return AppGenerationConfig; + })(); + + GenerateAppResourceRequest.EvaluationGenerationConfig = (function() { + + /** + * Properties of an EvaluationGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IEvaluationGenerationConfig + * @property {string|null} [datasetId] EvaluationGenerationConfig datasetId + */ + + /** + * Constructs a new EvaluationGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents an EvaluationGenerationConfig. + * @implements IEvaluationGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig=} [properties] Properties to set + */ + function EvaluationGenerationConfig(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]]; + } + + /** + * EvaluationGenerationConfig datasetId. + * @member {string} datasetId + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @instance + */ + EvaluationGenerationConfig.prototype.datasetId = ""; + + /** + * Creates a new EvaluationGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig} EvaluationGenerationConfig instance + */ + EvaluationGenerationConfig.create = function create(properties) { + return new EvaluationGenerationConfig(properties); + }; + + /** + * Encodes the specified EvaluationGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig} message EvaluationGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + return writer; + }; + + /** + * Encodes the specified EvaluationGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationGenerationConfig} message EvaluationGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig} EvaluationGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.datasetId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig} EvaluationGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + return null; + }; + + /** + * Creates an EvaluationGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig} EvaluationGenerationConfig + */ + EvaluationGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig(); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + return message; + }; + + /** + * Creates a plain object from an EvaluationGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig} message EvaluationGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationGenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.datasetId = ""; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + return object; + }; + + /** + * Converts this EvaluationGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig"; + }; + + return EvaluationGenerationConfig; + })(); + + GenerateAppResourceRequest.EvaluationPersonasGenerationConfig = (function() { + + /** + * Properties of an EvaluationPersonasGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IEvaluationPersonasGenerationConfig + */ + + /** + * Constructs a new EvaluationPersonasGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents an EvaluationPersonasGenerationConfig. + * @implements IEvaluationPersonasGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig=} [properties] Properties to set + */ + function EvaluationPersonasGenerationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new EvaluationPersonasGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig} EvaluationPersonasGenerationConfig instance + */ + EvaluationPersonasGenerationConfig.create = function create(properties) { + return new EvaluationPersonasGenerationConfig(properties); + }; + + /** + * Encodes the specified EvaluationPersonasGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig} message EvaluationPersonasGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationPersonasGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EvaluationPersonasGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IEvaluationPersonasGenerationConfig} message EvaluationPersonasGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationPersonasGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationPersonasGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig} EvaluationPersonasGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationPersonasGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationPersonasGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig} EvaluationPersonasGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationPersonasGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationPersonasGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationPersonasGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an EvaluationPersonasGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig} EvaluationPersonasGenerationConfig + */ + EvaluationPersonasGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig) + return object; + return new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig(); + }; + + /** + * Creates a plain object from an EvaluationPersonasGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig} message EvaluationPersonasGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationPersonasGenerationConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EvaluationPersonasGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + EvaluationPersonasGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationPersonasGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationPersonasGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig"; + }; + + return EvaluationPersonasGenerationConfig; + })(); + + GenerateAppResourceRequest.QualityReportGenerationConfig = (function() { + + /** + * Properties of a QualityReportGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IQualityReportGenerationConfig + * @property {string|null} [evaluationRun] QualityReportGenerationConfig evaluationRun + */ + + /** + * Constructs a new QualityReportGenerationConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents a QualityReportGenerationConfig. + * @implements IQualityReportGenerationConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig=} [properties] Properties to set + */ + function QualityReportGenerationConfig(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]]; + } + + /** + * QualityReportGenerationConfig evaluationRun. + * @member {string} evaluationRun + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @instance + */ + QualityReportGenerationConfig.prototype.evaluationRun = ""; + + /** + * Creates a new QualityReportGenerationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig} QualityReportGenerationConfig instance + */ + QualityReportGenerationConfig.create = function create(properties) { + return new QualityReportGenerationConfig(properties); + }; + + /** + * Encodes the specified QualityReportGenerationConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig} message QualityReportGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QualityReportGenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationRun != null && Object.hasOwnProperty.call(message, "evaluationRun")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.evaluationRun); + return writer; + }; + + /** + * Encodes the specified QualityReportGenerationConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IQualityReportGenerationConfig} message QualityReportGenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QualityReportGenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QualityReportGenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig} QualityReportGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QualityReportGenerationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.evaluationRun = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QualityReportGenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig} QualityReportGenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QualityReportGenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QualityReportGenerationConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QualityReportGenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + if (!$util.isString(message.evaluationRun)) + return "evaluationRun: string expected"; + return null; + }; + + /** + * Creates a QualityReportGenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig} QualityReportGenerationConfig + */ + QualityReportGenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig(); + if (object.evaluationRun != null) + message.evaluationRun = String(object.evaluationRun); + return message; + }; + + /** + * Creates a plain object from a QualityReportGenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig} message QualityReportGenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QualityReportGenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluationRun = ""; + if (message.evaluationRun != null && message.hasOwnProperty("evaluationRun")) + object.evaluationRun = message.evaluationRun; + return object; + }; + + /** + * Converts this QualityReportGenerationConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @instance + * @returns {Object.} JSON object + */ + QualityReportGenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QualityReportGenerationConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QualityReportGenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig"; + }; + + return QualityReportGenerationConfig; + })(); + + GenerateAppResourceRequest.HillClimbingFixConfig = (function() { + + /** + * Properties of a HillClimbingFixConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @interface IHillClimbingFixConfig + * @property {google.cloud.ces.v1beta.IQualityReport|null} [qualityReport] HillClimbingFixConfig qualityReport + */ + + /** + * Constructs a new HillClimbingFixConfig. + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest + * @classdesc Represents a HillClimbingFixConfig. + * @implements IHillClimbingFixConfig + * @constructor + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig=} [properties] Properties to set + */ + function HillClimbingFixConfig(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]]; + } + + /** + * HillClimbingFixConfig qualityReport. + * @member {google.cloud.ces.v1beta.IQualityReport|null|undefined} qualityReport + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @instance + */ + HillClimbingFixConfig.prototype.qualityReport = null; + + /** + * Creates a new HillClimbingFixConfig instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig} HillClimbingFixConfig instance + */ + HillClimbingFixConfig.create = function create(properties) { + return new HillClimbingFixConfig(properties); + }; + + /** + * Encodes the specified HillClimbingFixConfig message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig} message HillClimbingFixConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HillClimbingFixConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.qualityReport != null && Object.hasOwnProperty.call(message, "qualityReport")) + $root.google.cloud.ces.v1beta.QualityReport.encode(message.qualityReport, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HillClimbingFixConfig message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.IHillClimbingFixConfig} message HillClimbingFixConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HillClimbingFixConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HillClimbingFixConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig} HillClimbingFixConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HillClimbingFixConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.qualityReport = $root.google.cloud.ces.v1beta.QualityReport.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HillClimbingFixConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig} HillClimbingFixConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HillClimbingFixConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HillClimbingFixConfig message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HillClimbingFixConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.qualityReport != null && message.hasOwnProperty("qualityReport")) { + var error = $root.google.cloud.ces.v1beta.QualityReport.verify(message.qualityReport); + if (error) + return "qualityReport." + error; + } + return null; + }; + + /** + * Creates a HillClimbingFixConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig} HillClimbingFixConfig + */ + HillClimbingFixConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig(); + if (object.qualityReport != null) { + if (typeof object.qualityReport !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig.qualityReport: object expected"); + message.qualityReport = $root.google.cloud.ces.v1beta.QualityReport.fromObject(object.qualityReport); + } + return message; + }; + + /** + * Creates a plain object from a HillClimbingFixConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig} message HillClimbingFixConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HillClimbingFixConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.qualityReport = null; + if (message.qualityReport != null && message.hasOwnProperty("qualityReport")) + object.qualityReport = $root.google.cloud.ces.v1beta.QualityReport.toObject(message.qualityReport, options); + return object; + }; + + /** + * Converts this HillClimbingFixConfig to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @instance + * @returns {Object.} JSON object + */ + HillClimbingFixConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HillClimbingFixConfig + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HillClimbingFixConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig"; + }; + + return HillClimbingFixConfig; + })(); + + return GenerateAppResourceRequest; + })(); + v1beta.GenerateAppResourceResponse = (function() { /** @@ -92886,6 +95705,448 @@ return QualityReport; })(); + v1beta.GenerateAppResourceOperationMetadata = (function() { + + /** + * Properties of a GenerateAppResourceOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @interface IGenerateAppResourceOperationMetadata + * @property {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType|null} [generationType] GenerateAppResourceOperationMetadata generationType + * @property {string|null} [message] GenerateAppResourceOperationMetadata message + * @property {google.protobuf.ITimestamp|null} [createTime] GenerateAppResourceOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] GenerateAppResourceOperationMetadata endTime + * @property {string|null} [target] GenerateAppResourceOperationMetadata target + * @property {Array.|null} [partialErrors] GenerateAppResourceOperationMetadata partialErrors + */ + + /** + * Constructs a new GenerateAppResourceOperationMetadata. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a GenerateAppResourceOperationMetadata. + * @implements IGenerateAppResourceOperationMetadata + * @constructor + * @param {google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata=} [properties] Properties to set + */ + function GenerateAppResourceOperationMetadata(properties) { + this.partialErrors = []; + 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]]; + } + + /** + * GenerateAppResourceOperationMetadata generationType. + * @member {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType} generationType + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + */ + GenerateAppResourceOperationMetadata.prototype.generationType = 0; + + /** + * GenerateAppResourceOperationMetadata message. + * @member {string} message + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + */ + GenerateAppResourceOperationMetadata.prototype.message = ""; + + /** + * GenerateAppResourceOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + */ + GenerateAppResourceOperationMetadata.prototype.createTime = null; + + /** + * GenerateAppResourceOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + */ + GenerateAppResourceOperationMetadata.prototype.endTime = null; + + /** + * GenerateAppResourceOperationMetadata target. + * @member {string} target + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + */ + GenerateAppResourceOperationMetadata.prototype.target = ""; + + /** + * GenerateAppResourceOperationMetadata partialErrors. + * @member {Array.} partialErrors + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + */ + GenerateAppResourceOperationMetadata.prototype.partialErrors = $util.emptyArray; + + /** + * Creates a new GenerateAppResourceOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata} GenerateAppResourceOperationMetadata instance + */ + GenerateAppResourceOperationMetadata.create = function create(properties) { + return new GenerateAppResourceOperationMetadata(properties); + }; + + /** + * Encodes the specified GenerateAppResourceOperationMetadata message. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata} message GenerateAppResourceOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generationType != null && Object.hasOwnProperty.call(message, "generationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.generationType); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.target); + if (message.partialErrors != null && message.partialErrors.length) + for (var i = 0; i < message.partialErrors.length; ++i) + $root.google.rpc.Status.encode(message.partialErrors[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAppResourceOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.IGenerateAppResourceOperationMetadata} message GenerateAppResourceOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAppResourceOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAppResourceOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata} GenerateAppResourceOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generationType = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.target = reader.string(); + break; + } + case 6: { + if (!(message.partialErrors && message.partialErrors.length)) + message.partialErrors = []; + message.partialErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAppResourceOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata} GenerateAppResourceOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAppResourceOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAppResourceOperationMetadata message. + * @function verify + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAppResourceOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.generationType != null && message.hasOwnProperty("generationType")) + switch (message.generationType) { + default: + return "generationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 6: + case 8: + case 9: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.partialErrors != null && message.hasOwnProperty("partialErrors")) { + if (!Array.isArray(message.partialErrors)) + return "partialErrors: array expected"; + for (var i = 0; i < message.partialErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialErrors[i]); + if (error) + return "partialErrors." + error; + } + } + return null; + }; + + /** + * Creates a GenerateAppResourceOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata} GenerateAppResourceOperationMetadata + */ + GenerateAppResourceOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata) + return object; + var message = new $root.google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata(); + switch (object.generationType) { + default: + if (typeof object.generationType === "number") { + message.generationType = object.generationType; + break; + } + break; + case "GENERATION_TYPE_UNSPECIFIED": + case 0: + message.generationType = 0; + break; + case "AGENT_RESTRUCTURE": + case 1: + message.generationType = 1; + break; + case "AGENT_REFINE": + case 2: + message.generationType = 2; + break; + case "AGENT_CREATE": + case 3: + message.generationType = 3; + break; + case "TOOL_CREATE": + case 4: + message.generationType = 4; + break; + case "SCENARIO_CREATE": + case 5: + message.generationType = 5; + break; + case "SCENARIO_CREATE_FROM_TRANSCRIPTS": + case 7: + message.generationType = 7; + break; + case "EVALUATION_PERSONA_CREATE": + case 6: + message.generationType = 6; + break; + case "QUALITY_REPORT_CREATE": + case 8: + message.generationType = 8; + break; + case "INSTRUCTION_FOLLOWING_FIX": + case 9: + message.generationType = 9; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.partialErrors) { + if (!Array.isArray(object.partialErrors)) + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.partialErrors: array expected"); + message.partialErrors = []; + for (var i = 0; i < object.partialErrors.length; ++i) { + if (typeof object.partialErrors[i] !== "object") + throw TypeError(".google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.partialErrors: object expected"); + message.partialErrors[i] = $root.google.rpc.Status.fromObject(object.partialErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateAppResourceOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata} message GenerateAppResourceOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAppResourceOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialErrors = []; + if (options.defaults) { + object.generationType = options.enums === String ? "GENERATION_TYPE_UNSPECIFIED" : 0; + object.message = ""; + object.createTime = null; + object.endTime = null; + object.target = ""; + } + if (message.generationType != null && message.hasOwnProperty("generationType")) + object.generationType = options.enums === String ? $root.google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType[message.generationType] === undefined ? message.generationType : $root.google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType[message.generationType] : message.generationType; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.partialErrors && message.partialErrors.length) { + object.partialErrors = []; + for (var j = 0; j < message.partialErrors.length; ++j) + object.partialErrors[j] = $root.google.rpc.Status.toObject(message.partialErrors[j], options); + } + return object; + }; + + /** + * Converts this GenerateAppResourceOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + GenerateAppResourceOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAppResourceOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAppResourceOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata"; + }; + + /** + * GenerationType enum. + * @name google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata.GenerationType + * @enum {number} + * @property {number} GENERATION_TYPE_UNSPECIFIED=0 GENERATION_TYPE_UNSPECIFIED value + * @property {number} AGENT_RESTRUCTURE=1 AGENT_RESTRUCTURE value + * @property {number} AGENT_REFINE=2 AGENT_REFINE value + * @property {number} AGENT_CREATE=3 AGENT_CREATE value + * @property {number} TOOL_CREATE=4 TOOL_CREATE value + * @property {number} SCENARIO_CREATE=5 SCENARIO_CREATE value + * @property {number} SCENARIO_CREATE_FROM_TRANSCRIPTS=7 SCENARIO_CREATE_FROM_TRANSCRIPTS value + * @property {number} EVALUATION_PERSONA_CREATE=6 EVALUATION_PERSONA_CREATE value + * @property {number} QUALITY_REPORT_CREATE=8 QUALITY_REPORT_CREATE value + * @property {number} INSTRUCTION_FOLLOWING_FIX=9 INSTRUCTION_FOLLOWING_FIX value + */ + GenerateAppResourceOperationMetadata.GenerationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GENERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGENT_RESTRUCTURE"] = 1; + values[valuesById[2] = "AGENT_REFINE"] = 2; + values[valuesById[3] = "AGENT_CREATE"] = 3; + values[valuesById[4] = "TOOL_CREATE"] = 4; + values[valuesById[5] = "SCENARIO_CREATE"] = 5; + values[valuesById[7] = "SCENARIO_CREATE_FROM_TRANSCRIPTS"] = 7; + values[valuesById[6] = "EVALUATION_PERSONA_CREATE"] = 6; + values[valuesById[8] = "QUALITY_REPORT_CREATE"] = 8; + values[valuesById[9] = "INSTRUCTION_FOLLOWING_FIX"] = 9; + return values; + })(); + + return GenerateAppResourceOperationMetadata; + })(); + v1beta.ListChangelogsRequest = (function() { /** @@ -110700,6 +113961,7 @@ * @property {string|null} [name] AgentTool name * @property {string|null} [description] AgentTool description * @property {string|null} [rootAgent] AgentTool rootAgent + * @property {string|null} [agent] AgentTool agent */ /** @@ -110741,6 +114003,14 @@ */ AgentTool.prototype.rootAgent = ""; + /** + * AgentTool agent. + * @member {string} agent + * @memberof google.cloud.ces.v1beta.AgentTool + * @instance + */ + AgentTool.prototype.agent = ""; + /** * Creates a new AgentTool instance using the specified properties. * @function create @@ -110771,6 +114041,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); if (message.rootAgent != null && Object.hasOwnProperty.call(message, "rootAgent")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.rootAgent); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.agent); return writer; }; @@ -110819,6 +114091,10 @@ message.rootAgent = reader.string(); break; } + case 4: { + message.agent = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -110863,6 +114139,9 @@ if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) if (!$util.isString(message.rootAgent)) return "rootAgent: string expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; return null; }; @@ -110884,6 +114163,8 @@ message.description = String(object.description); if (object.rootAgent != null) message.rootAgent = String(object.rootAgent); + if (object.agent != null) + message.agent = String(object.agent); return message; }; @@ -110904,6 +114185,7 @@ object.name = ""; object.description = ""; object.rootAgent = ""; + object.agent = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -110911,6 +114193,8 @@ object.description = message.description; if (message.rootAgent != null && message.hasOwnProperty("rootAgent")) object.rootAgent = message.rootAgent; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; return object; }; @@ -124045,6 +127329,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.inputTypes != null && message.hasOwnProperty("inputTypes")) { @@ -124171,6 +127456,10 @@ case 3: message.source = 3; break; + case "AGENT_TOOL": + case 4: + message.source = 4; + break; } if (object.inputTypes) { if (!Array.isArray(object.inputTypes)) @@ -124609,6 +127898,7 @@ * @property {number} LIVE=1 LIVE value * @property {number} SIMULATOR=2 SIMULATOR value * @property {number} EVAL=3 EVAL value + * @property {number} AGENT_TOOL=4 AGENT_TOOL value */ Conversation.Source = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -124616,6 +127906,7 @@ values[valuesById[1] = "LIVE"] = 1; values[valuesById[2] = "SIMULATOR"] = 2; values[valuesById[3] = "EVAL"] = 3; + values[valuesById[4] = "AGENT_TOOL"] = 4; return values; })(); @@ -150098,6 +153389,496 @@ return WebSearchQuery; })(); + v1beta.FileContext = (function() { + + /** + * Properties of a FileContext. + * @memberof google.cloud.ces.v1beta + * @interface IFileContext + * @property {google.cloud.ces.v1beta.FileContext.IFileBytes|null} [fileBytes] FileContext fileBytes + */ + + /** + * Constructs a new FileContext. + * @memberof google.cloud.ces.v1beta + * @classdesc Represents a FileContext. + * @implements IFileContext + * @constructor + * @param {google.cloud.ces.v1beta.IFileContext=} [properties] Properties to set + */ + function FileContext(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]]; + } + + /** + * FileContext fileBytes. + * @member {google.cloud.ces.v1beta.FileContext.IFileBytes|null|undefined} fileBytes + * @memberof google.cloud.ces.v1beta.FileContext + * @instance + */ + FileContext.prototype.fileBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FileContext file. + * @member {"fileBytes"|undefined} file + * @memberof google.cloud.ces.v1beta.FileContext + * @instance + */ + Object.defineProperty(FileContext.prototype, "file", { + get: $util.oneOfGetter($oneOfFields = ["fileBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FileContext instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {google.cloud.ces.v1beta.IFileContext=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.FileContext} FileContext instance + */ + FileContext.create = function create(properties) { + return new FileContext(properties); + }; + + /** + * Encodes the specified FileContext message. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {google.cloud.ces.v1beta.IFileContext} message FileContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileBytes != null && Object.hasOwnProperty.call(message, "fileBytes")) + $root.google.cloud.ces.v1beta.FileContext.FileBytes.encode(message.fileBytes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileContext message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {google.cloud.ces.v1beta.IFileContext} message FileContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.FileContext} FileContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileContext.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.FileContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fileBytes = $root.google.cloud.ces.v1beta.FileContext.FileBytes.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.FileContext} FileContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileContext message. + * @function verify + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fileBytes != null && message.hasOwnProperty("fileBytes")) { + properties.file = 1; + { + var error = $root.google.cloud.ces.v1beta.FileContext.FileBytes.verify(message.fileBytes); + if (error) + return "fileBytes." + error; + } + } + return null; + }; + + /** + * Creates a FileContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.FileContext} FileContext + */ + FileContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.FileContext) + return object; + var message = new $root.google.cloud.ces.v1beta.FileContext(); + if (object.fileBytes != null) { + if (typeof object.fileBytes !== "object") + throw TypeError(".google.cloud.ces.v1beta.FileContext.fileBytes: object expected"); + message.fileBytes = $root.google.cloud.ces.v1beta.FileContext.FileBytes.fromObject(object.fileBytes); + } + return message; + }; + + /** + * Creates a plain object from a FileContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {google.cloud.ces.v1beta.FileContext} message FileContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fileBytes != null && message.hasOwnProperty("fileBytes")) { + object.fileBytes = $root.google.cloud.ces.v1beta.FileContext.FileBytes.toObject(message.fileBytes, options); + if (options.oneofs) + object.file = "fileBytes"; + } + return object; + }; + + /** + * Converts this FileContext to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.FileContext + * @instance + * @returns {Object.} JSON object + */ + FileContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileContext + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.FileContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.FileContext"; + }; + + FileContext.FileBytes = (function() { + + /** + * Properties of a FileBytes. + * @memberof google.cloud.ces.v1beta.FileContext + * @interface IFileBytes + * @property {string|null} [fileName] FileBytes fileName + * @property {string|null} [mimeType] FileBytes mimeType + * @property {Uint8Array|null} [data] FileBytes data + */ + + /** + * Constructs a new FileBytes. + * @memberof google.cloud.ces.v1beta.FileContext + * @classdesc Represents a FileBytes. + * @implements IFileBytes + * @constructor + * @param {google.cloud.ces.v1beta.FileContext.IFileBytes=} [properties] Properties to set + */ + function FileBytes(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]]; + } + + /** + * FileBytes fileName. + * @member {string} fileName + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @instance + */ + FileBytes.prototype.fileName = ""; + + /** + * FileBytes mimeType. + * @member {string} mimeType + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @instance + */ + FileBytes.prototype.mimeType = ""; + + /** + * FileBytes data. + * @member {Uint8Array} data + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @instance + */ + FileBytes.prototype.data = $util.newBuffer([]); + + /** + * Creates a new FileBytes instance using the specified properties. + * @function create + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {google.cloud.ces.v1beta.FileContext.IFileBytes=} [properties] Properties to set + * @returns {google.cloud.ces.v1beta.FileContext.FileBytes} FileBytes instance + */ + FileBytes.create = function create(properties) { + return new FileBytes(properties); + }; + + /** + * Encodes the specified FileBytes message. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.FileBytes.verify|verify} messages. + * @function encode + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {google.cloud.ces.v1beta.FileContext.IFileBytes} message FileBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileBytes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileName); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified FileBytes message, length delimited. Does not implicitly {@link google.cloud.ces.v1beta.FileContext.FileBytes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {google.cloud.ces.v1beta.FileContext.IFileBytes} message FileBytes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileBytes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileBytes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.ces.v1beta.FileContext.FileBytes} FileBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileBytes.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.ces.v1beta.FileContext.FileBytes(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fileName = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileBytes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.ces.v1beta.FileContext.FileBytes} FileBytes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileBytes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileBytes message. + * @function verify + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileBytes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a FileBytes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.ces.v1beta.FileContext.FileBytes} FileBytes + */ + FileBytes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.ces.v1beta.FileContext.FileBytes) + return object; + var message = new $root.google.cloud.ces.v1beta.FileContext.FileBytes(); + if (object.fileName != null) + message.fileName = String(object.fileName); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a FileBytes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {google.cloud.ces.v1beta.FileContext.FileBytes} message FileBytes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileBytes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fileName = ""; + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this FileBytes to JSON. + * @function toJSON + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @instance + * @returns {Object.} JSON object + */ + FileBytes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileBytes + * @function getTypeUrl + * @memberof google.cloud.ces.v1beta.FileContext.FileBytes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.ces.v1beta.FileContext.FileBytes"; + }; + + return FileBytes; + })(); + + return FileContext; + })(); + v1beta.SecuritySettings = (function() { /** @@ -153077,6 +156858,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -153119,6 +156901,10 @@ case 3: message.source = 3; break; + case "AGENT_TOOL": + case 4: + message.source = 4; + break; } return message; }; diff --git a/packages/google-cloud-ces/protos/protos.json b/packages/google-cloud-ces/protos/protos.json index 28fab613157..82b2cbc8cbe 100644 --- a/packages/google-cloud-ces/protos/protos.json +++ b/packages/google-cloud-ces/protos/protos.json @@ -9897,6 +9897,34 @@ } ] }, + "GenerateAppResource": { + "requestType": "GenerateAppResourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/apps/*}:generateAppResource", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "GenerateAppResourceResponse", + "(google.longrunning.operation_info).metadata_type": "GenerateAppResourceOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/apps/*}:generateAppResource", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GenerateAppResourceResponse", + "metadata_type": "GenerateAppResourceOperationMetadata" + } + } + ] + }, "ListChangelogs": { "requestType": "ListChangelogsRequest", "responseType": "ListChangelogsResponse", @@ -11318,6 +11346,283 @@ "RestoreAppVersionResponse": { "fields": {} }, + "GenerateAppResourceRequest": { + "oneofs": { + "resource": { + "oneof": [ + "agent", + "tool", + "toolset" + ] + } + }, + "fields": { + "agent": { + "type": "Agent", + "id": 2 + }, + "tool": { + "type": "Tool", + "id": 4 + }, + "toolset": { + "type": "Toolset", + "id": 6 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/App" + } + }, + "refineInstructions": { + "rule": "repeated", + "type": "RefineInstructions", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolGenerationConfig": { + "type": "ToolGenerationConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "appGenerationConfig": { + "type": "AppGenerationConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationGenerationConfig": { + "type": "EvaluationGenerationConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "evaluationPersonasGenerationConfig": { + "type": "EvaluationPersonasGenerationConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "qualityReportGenerationConfig": { + "type": "QualityReportGenerationConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hillClimbingFixConfig": { + "type": "HillClimbingFixConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RefineInstructions": { + "fields": { + "startIndex": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endIndex": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instructions": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolGenerationConfig": { + "fields": { + "context": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileContexts": { + "rule": "repeated", + "type": "FileContext", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "openApiToolsetGenerationConfig": { + "type": "OpenApiToolsetGenerationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OpenApiToolsetGenerationConfig": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "operationGenerationConfigs": { + "rule": "repeated", + "type": "OperationGenerationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OperationGenerationConfig": { + "fields": { + "method": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "path": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestJson": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "responseJson": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + }, + "AppGenerationConfig": { + "fields": { + "context": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileContexts": { + "rule": "repeated", + "type": "FileContext", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "datasetId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "contactcenterinsights.googleapis.com/Dataset" + } + }, + "generateEvaluations": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsLocation": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EvaluationGenerationConfig": { + "fields": { + "datasetId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "contactcenterinsights.googleapis.com/Dataset" + } + } + } + }, + "EvaluationPersonasGenerationConfig": { + "fields": {} + }, + "QualityReportGenerationConfig": { + "fields": { + "evaluationRun": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "ces.googleapis.com/EvaluationRun" + } + } + } + }, + "HillClimbingFixConfig": { + "fields": { + "qualityReport": { + "type": "QualityReport", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "GenerateAppResourceResponse": { "oneofs": { "generatedResource": { @@ -11482,6 +11787,69 @@ } } }, + "GenerateAppResourceOperationMetadata": { + "fields": { + "generationType": { + "type": "GenerationType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "message": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "partialErrors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GenerationType": { + "values": { + "GENERATION_TYPE_UNSPECIFIED": 0, + "AGENT_RESTRUCTURE": 1, + "AGENT_REFINE": 2, + "AGENT_CREATE": 3, + "TOOL_CREATE": 4, + "SCENARIO_CREATE": 5, + "SCENARIO_CREATE_FROM_TRANSCRIPTS": 7, + "EVALUATION_PERSONA_CREATE": 6, + "QUALITY_REPORT_CREATE": 8, + "INSTRUCTION_FOLLOWING_FIX": 9 + } + } + } + }, "ListChangelogsRequest": { "fields": { "parent": { @@ -13716,6 +14084,15 @@ "rootAgent": { "type": "string", "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "ces.googleapis.com/Agent" + } + }, + "agent": { + "type": "string", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "ces.googleapis.com/Agent" @@ -15360,7 +15737,8 @@ "SOURCE_UNSPECIFIED": 0, "LIVE": 1, "SIMULATOR": 2, - "EVAL": 3 + "EVAL": 3, + "AGENT_TOOL": 4 } }, "InputType": { @@ -18623,6 +19001,51 @@ } } }, + "FileContext": { + "oneofs": { + "file": { + "oneof": [ + "fileBytes" + ] + } + }, + "fields": { + "fileBytes": { + "type": "FileBytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "FileBytes": { + "fields": { + "fileName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "data": { + "type": "bytes", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, "SecuritySettings": { "options": { "(google.api.resource).type": "ces.googleapis.com/SecuritySettings", diff --git a/packages/google-cloud-ces/samples/generated/v1beta/agent_service.generate_app_resource.js b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.generate_app_resource.js new file mode 100644 index 00000000000..bb113041b27 --- /dev/null +++ b/packages/google-cloud-ces/samples/generated/v1beta/agent_service.generate_app_resource.js @@ -0,0 +1,105 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START ces_v1beta_generated_AgentService_GenerateAppResource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The agent resource to be used by the LLM assistant, can be empty for + * generating a new agent. + */ + // const agent = {} + /** + * The tool resource to be used by the LLM assistant, can be empty for + * generating a new tool. + */ + // const tool = {} + /** + * The toolset resource to be used by the LLM assistant, can be empty for + * generating a new toolset. + */ + // const toolset = {} + /** + * Required. The resource name of the app to generate the resource for. + */ + // const parent = 'abc123' + /** + * Optional. List of refine instructions to be used to refine the resource. + */ + // const refineInstructions = [1,2,3,4] + /** + * Optional. The configuration to be used to generate the tool. + */ + // const toolGenerationConfig = {} + /** + * Optional. The configuration to be used to generate the agents and tools. + */ + // const appGenerationConfig = {} + /** + * Optional. The configuration to be used to generate the evaluations. + */ + // const evaluationGenerationConfig = {} + /** + * Optional. The configuration to be used to generate the evaluation personas. + */ + // const evaluationPersonasGenerationConfig = {} + /** + * Optional. The configuration to be used for quality report generation. + */ + // const qualityReportGenerationConfig = {} + /** + * Optional. The configuration to be used for hill climbing fixes. + */ + // const hillClimbingFixConfig = {} + + // Imports the Ces library + const {AgentServiceClient} = require('@google-cloud/ces').v1beta; + + // Instantiates a client + const cesClient = new AgentServiceClient(); + + async function callGenerateAppResource() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await cesClient.generateAppResource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callGenerateAppResource(); + // [END ces_v1beta_generated_AgentService_GenerateAppResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json b/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json index 1cd1bb9460e..23a56a9ba9a 100644 --- a/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json +++ b/packages/google-cloud-ces/samples/generated/v1beta/snippet_metadata_google.cloud.ces.v1beta.json @@ -2267,6 +2267,86 @@ } } }, + { + "regionTag": "ces_v1beta_generated_AgentService_GenerateAppResource_async", + "title": "AgentService generateAppResource Sample", + "origin": "API_DEFINITION", + "description": " Generates specific resources (e.g. agent) in the app using LLM assistant.", + "canonical": true, + "file": "agent_service.generate_app_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 97, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateAppResource", + "fullName": "google.cloud.ces.v1beta.AgentService.GenerateAppResource", + "async": true, + "parameters": [ + { + "name": "agent", + "type": ".google.cloud.ces.v1beta.Agent" + }, + { + "name": "tool", + "type": ".google.cloud.ces.v1beta.Tool" + }, + { + "name": "toolset", + "type": ".google.cloud.ces.v1beta.Toolset" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "refine_instructions", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "tool_generation_config", + "type": ".google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig" + }, + { + "name": "app_generation_config", + "type": ".google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig" + }, + { + "name": "evaluation_generation_config", + "type": ".google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig" + }, + { + "name": "evaluation_personas_generation_config", + "type": ".google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig" + }, + { + "name": "quality_report_generation_config", + "type": ".google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig" + }, + { + "name": "hill_climbing_fix_config", + "type": ".google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AgentServiceClient", + "fullName": "google.cloud.ces.v1beta.AgentServiceClient" + }, + "method": { + "shortName": "GenerateAppResource", + "fullName": "google.cloud.ces.v1beta.AgentService.GenerateAppResource", + "service": { + "shortName": "AgentService", + "fullName": "google.cloud.ces.v1beta.AgentService" + } + } + } + }, { "regionTag": "ces_v1beta_generated_AgentService_ListChangelogs_async", "title": "AgentService listChangelogs Sample", diff --git a/packages/google-cloud-ces/src/v1beta/agent_service_client.ts b/packages/google-cloud-ces/src/v1beta/agent_service_client.ts index bc79dd0c5db..061288c8c66 100644 --- a/packages/google-cloud-ces/src/v1beta/agent_service_client.ts +++ b/packages/google-cloud-ces/src/v1beta/agent_service_client.ts @@ -310,6 +310,10 @@ export class AgentServiceClient { '.google.cloud.ces.v1beta.RestoreAppVersionResponse') as gax.protobuf.Type; const restoreAppVersionMetadata = protoFilesRoot.lookup( '.google.cloud.ces.v1beta.OperationMetadata') as gax.protobuf.Type; + const generateAppResourceResponse = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.GenerateAppResourceResponse') as gax.protobuf.Type; + const generateAppResourceMetadata = protoFilesRoot.lookup( + '.google.cloud.ces.v1beta.GenerateAppResourceOperationMetadata') as gax.protobuf.Type; this.descriptors.longrunning = { createApp: new this._gaxModule.LongrunningDescriptor( @@ -335,7 +339,11 @@ export class AgentServiceClient { restoreAppVersion: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restoreAppVersionResponse.decode.bind(restoreAppVersionResponse), - restoreAppVersionMetadata.decode.bind(restoreAppVersionMetadata)) + restoreAppVersionMetadata.decode.bind(restoreAppVersionMetadata)), + generateAppResource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + generateAppResourceResponse.decode.bind(generateAppResourceResponse), + generateAppResourceMetadata.decode.bind(generateAppResourceMetadata)) }; // Put together the default options sent with requests. @@ -381,7 +389,7 @@ export class AgentServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const agentServiceStubMethods = - ['listApps', 'getApp', 'createApp', 'updateApp', 'deleteApp', 'exportApp', 'importApp', 'getSecuritySettings', 'updateSecuritySettings', 'listAgents', 'getAgent', 'createAgent', 'updateAgent', 'deleteAgent', 'listExamples', 'getExample', 'createExample', 'updateExample', 'deleteExample', 'listTools', 'getTool', 'listConversations', 'getConversation', 'deleteConversation', 'batchDeleteConversations', 'createTool', 'updateTool', 'deleteTool', 'listGuardrails', 'getGuardrail', 'createGuardrail', 'updateGuardrail', 'deleteGuardrail', 'listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listToolsets', 'getToolset', 'createToolset', 'updateToolset', 'deleteToolset', 'listAppVersions', 'getAppVersion', 'createAppVersion', 'deleteAppVersion', 'restoreAppVersion', 'listChangelogs', 'getChangelog']; + ['listApps', 'getApp', 'createApp', 'updateApp', 'deleteApp', 'exportApp', 'importApp', 'getSecuritySettings', 'updateSecuritySettings', 'listAgents', 'getAgent', 'createAgent', 'updateAgent', 'deleteAgent', 'listExamples', 'getExample', 'createExample', 'updateExample', 'deleteExample', 'listTools', 'getTool', 'listConversations', 'getConversation', 'deleteConversation', 'batchDeleteConversations', 'createTool', 'updateTool', 'deleteTool', 'listGuardrails', 'getGuardrail', 'createGuardrail', 'updateGuardrail', 'deleteGuardrail', 'listDeployments', 'getDeployment', 'createDeployment', 'updateDeployment', 'deleteDeployment', 'listToolsets', 'getToolset', 'createToolset', 'updateToolset', 'deleteToolset', 'listAppVersions', 'getAppVersion', 'createAppVersion', 'deleteAppVersion', 'restoreAppVersion', 'generateAppResource', 'listChangelogs', 'getChangelog']; for (const methodName of agentServiceStubMethods) { const callPromise = this.agentServiceStub.then( stub => (...args: Array<{}>) => { @@ -4525,6 +4533,136 @@ export class AgentServiceClient { const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restoreAppVersion, this._gaxModule.createDefaultBackoffSettings()); return decodeOperation as LROperation; } +/** + * Generates specific resources (e.g. agent) in the app using LLM assistant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.ces.v1beta.Agent} request.agent + * The agent resource to be used by the LLM assistant, can be empty for + * generating a new agent. + * @param {google.cloud.ces.v1beta.Tool} request.tool + * The tool resource to be used by the LLM assistant, can be empty for + * generating a new tool. + * @param {google.cloud.ces.v1beta.Toolset} request.toolset + * The toolset resource to be used by the LLM assistant, can be empty for + * generating a new toolset. + * @param {string} request.parent + * Required. The resource name of the app to generate the resource for. + * @param {number[]} [request.refineInstructions] + * Optional. List of refine instructions to be used to refine the resource. + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.ToolGenerationConfig} [request.toolGenerationConfig] + * Optional. The configuration to be used to generate the tool. + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.AppGenerationConfig} [request.appGenerationConfig] + * Optional. The configuration to be used to generate the agents and tools. + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationGenerationConfig} [request.evaluationGenerationConfig] + * Optional. The configuration to be used to generate the evaluations. + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.EvaluationPersonasGenerationConfig} [request.evaluationPersonasGenerationConfig] + * Optional. The configuration to be used to generate the evaluation personas. + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.QualityReportGenerationConfig} [request.qualityReportGenerationConfig] + * Optional. The configuration to be used for quality report generation. + * @param {google.cloud.ces.v1beta.GenerateAppResourceRequest.HillClimbingFixConfig} [request.hillClimbingFixConfig] + * Optional. The configuration to be used for hill climbing fixes. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/agent_service.generate_app_resource.js + * region_tag:ces_v1beta_generated_AgentService_GenerateAppResource_async + */ + generateAppResource( + request?: protos.google.cloud.ces.v1beta.IGenerateAppResourceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + generateAppResource( + request: protos.google.cloud.ces.v1beta.IGenerateAppResourceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + generateAppResource( + request: protos.google.cloud.ces.v1beta.IGenerateAppResourceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + generateAppResource( + request?: protos.google.cloud.ces.v1beta.IGenerateAppResourceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('generateAppResource response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('generateAppResource request %j', request); + return this.innerApiCalls.generateAppResource(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('generateAppResource response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `generateAppResource()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/agent_service.generate_app_resource.js + * region_tag:ces_v1beta_generated_AgentService_GenerateAppResource_async + */ + async checkGenerateAppResourceProgress(name: string): Promise>{ + this._log.info('generateAppResource long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.generateAppResource, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } /** * Lists apps in the given project and location. * diff --git a/packages/google-cloud-ces/src/v1beta/agent_service_client_config.json b/packages/google-cloud-ces/src/v1beta/agent_service_client_config.json index a9da4f6dba2..2c3c8470093 100644 --- a/packages/google-cloud-ces/src/v1beta/agent_service_client_config.json +++ b/packages/google-cloud-ces/src/v1beta/agent_service_client_config.json @@ -260,6 +260,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "GenerateAppResource": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "ListChangelogs": { "timeout_millis": 60000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-ces/src/v1beta/agent_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/agent_service_proto_list.json index 4255a8b1d1e..9c794c57e7c 100644 --- a/packages/google-cloud-ces/src/v1beta/agent_service_proto_list.json +++ b/packages/google-cloud-ces/src/v1beta/agent_service_proto_list.json @@ -20,6 +20,7 @@ "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", "../../protos/google/cloud/ces/v1beta/example.proto", "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_context.proto", "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", "../../protos/google/cloud/ces/v1beta/golden_run.proto", "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", diff --git a/packages/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json index 4255a8b1d1e..9c794c57e7c 100644 --- a/packages/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json +++ b/packages/google-cloud-ces/src/v1beta/evaluation_service_proto_list.json @@ -20,6 +20,7 @@ "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", "../../protos/google/cloud/ces/v1beta/example.proto", "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_context.proto", "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", "../../protos/google/cloud/ces/v1beta/golden_run.proto", "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", diff --git a/packages/google-cloud-ces/src/v1beta/gapic_metadata.json b/packages/google-cloud-ces/src/v1beta/gapic_metadata.json index 370e2134460..c1953600bc7 100644 --- a/packages/google-cloud-ces/src/v1beta/gapic_metadata.json +++ b/packages/google-cloud-ces/src/v1beta/gapic_metadata.json @@ -210,6 +210,11 @@ "restoreAppVersion" ] }, + "GenerateAppResource": { + "methods": [ + "generateAppResource" + ] + }, "ListApps": { "methods": [ "listApps", @@ -485,6 +490,11 @@ "restoreAppVersion" ] }, + "GenerateAppResource": { + "methods": [ + "generateAppResource" + ] + }, "ListApps": { "methods": [ "listApps", diff --git a/packages/google-cloud-ces/src/v1beta/session_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/session_service_proto_list.json index 4255a8b1d1e..9c794c57e7c 100644 --- a/packages/google-cloud-ces/src/v1beta/session_service_proto_list.json +++ b/packages/google-cloud-ces/src/v1beta/session_service_proto_list.json @@ -20,6 +20,7 @@ "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", "../../protos/google/cloud/ces/v1beta/example.proto", "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_context.proto", "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", "../../protos/google/cloud/ces/v1beta/golden_run.proto", "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", diff --git a/packages/google-cloud-ces/src/v1beta/tool_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/tool_service_proto_list.json index 4255a8b1d1e..9c794c57e7c 100644 --- a/packages/google-cloud-ces/src/v1beta/tool_service_proto_list.json +++ b/packages/google-cloud-ces/src/v1beta/tool_service_proto_list.json @@ -20,6 +20,7 @@ "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", "../../protos/google/cloud/ces/v1beta/example.proto", "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_context.proto", "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", "../../protos/google/cloud/ces/v1beta/golden_run.proto", "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", diff --git a/packages/google-cloud-ces/src/v1beta/widget_service_proto_list.json b/packages/google-cloud-ces/src/v1beta/widget_service_proto_list.json index 4255a8b1d1e..9c794c57e7c 100644 --- a/packages/google-cloud-ces/src/v1beta/widget_service_proto_list.json +++ b/packages/google-cloud-ces/src/v1beta/widget_service_proto_list.json @@ -20,6 +20,7 @@ "../../protos/google/cloud/ces/v1beta/evaluation_service.proto", "../../protos/google/cloud/ces/v1beta/example.proto", "../../protos/google/cloud/ces/v1beta/fakes.proto", + "../../protos/google/cloud/ces/v1beta/file_context.proto", "../../protos/google/cloud/ces/v1beta/file_search_tool.proto", "../../protos/google/cloud/ces/v1beta/golden_run.proto", "../../protos/google/cloud/ces/v1beta/google_search_tool.proto", diff --git a/packages/google-cloud-ces/system-test/install.ts b/packages/google-cloud-ces/system-test/install.ts index 394f3362d20..f66069aa394 100644 --- a/packages/google-cloud-ces/system-test/install.ts +++ b/packages/google-cloud-ces/system-test/install.ts @@ -40,7 +40,7 @@ describe('📦 pack-n-play test', () => { packageDir: process.cwd(), sample: { description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + cjs: readFileSync('./system-test/fixtures/sample/src/index.js').toString() } }; await packNTest(options); diff --git a/packages/google-cloud-ces/test/gapic_agent_service_v1beta.ts b/packages/google-cloud-ces/test/gapic_agent_service_v1beta.ts index e1e48568e64..46bad7c1a54 100644 --- a/packages/google-cloud-ces/test/gapic_agent_service_v1beta.ts +++ b/packages/google-cloud-ces/test/gapic_agent_service_v1beta.ts @@ -4903,6 +4903,160 @@ describe('v1beta.AgentServiceClient', () => { }); }); + describe('generateAppResource', () => { + it('invokes generateAppResource without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateAppResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateAppResourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.generateAppResource = stubLongRunningCall(expectedResponse); + const [operation] = await client.generateAppResource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAppResource without error using callback', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateAppResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateAppResourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.generateAppResource = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateAppResource( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAppResource with call error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateAppResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateAppResourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateAppResource = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.generateAppResource(request), expectedError); + const actualRequest = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAppResource with LRO error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.ces.v1beta.GenerateAppResourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.ces.v1beta.GenerateAppResourceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateAppResource = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.generateAppResource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateAppResource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkGenerateAppResourceProgress without error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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.checkGenerateAppResourceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkGenerateAppResourceProgress with error', async () => { + const client = new agentserviceModule.v1beta.AgentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkGenerateAppResourceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('listApps', () => { it('invokes listApps without error', async () => { const client = new agentserviceModule.v1beta.AgentServiceClient({